Hi all,
My app Windows forms .NET in Win XP copy files pdfs in shared network folder in a server win 2003.
Admin user in Win2003 detects some corrupt files pdfs, in that shared folder.
HOw can I check if a fileis copied right in shared folder ?? thanks !!
the code: I use two ways to copy/move files to shared folder
NOte: my app generates PDFs files
Write Bytes to disk (the shared folder)
Public Shared Function GenerarFicheroDeBytes(ByVal datosFichero As Byte(), ByVal rutaFisicaFichero As String) As FileStream
If Not Directory.Exists(Path.GetDirectoryName(rutaFisicaFichero)) Then Directory.CreateDirectory(Path.GetDirectoryName(rutaFisicaFichero)) End If Dim fs As New FileStream(rutaFisicaFichero, FileMode.OpenOrCreate, FileAccess.Write) fs.Write(datosFichero, 0, datosFichero.Length) fs.Flush() fs.Close() Return fs
End Function
2 Move File to shared network folder
Public Function MoverFicheroABuzonParaIndexar(ByVal rutaProcesarFicherosBuzon As String, ByVal nombreFichero As String) As String
Dim nombreFicheroPDF As String = String.Empty
Dim nombreFicheroPDFRenombrado As String = String.Empty
Dim nombreFicheroBuzon As String = String.Empty
nombreFicheroPDF = ... Path.GetFileNameWithoutExtension(...)
nombreFicheroBuzon = ObtenerRutaFicheroBuzonParaIndexar(...)
File.Move(nombreFicheroPDF, nombreFicheroBuzon)
Return nombreFicheroBuzon
End Function
Greetings
thanks in advanced, please