Non posso inserire msbox non lo gestisco :-)
codice:
If System.IO.File.Exists(FileLog) Then
Exit Try
Else
Write("D:\Progetti\PowerStoreSentinel\PowerStoreSentinel\PowerStoreSentinel\CartellaProvaFile\txt.txt", "entro creo file ")
Dim scrivi As New System.IO.StreamWriter(FileLog)
scrivi.Write("Prova")
scrivi.Close()
Write("D:\Progetti\PowerStoreSentinel\PowerStoreSentinel\PowerStoreSentinel\CartellaProvaFile\txt.txt", "creo file ")
End If
mi da questo errore
:
codice:
entro in errori lod System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Progetti\PowerStoreSentinel\PowerStoreSentinel\PowerStoreSentinel\log\LogApplication20080716.txt'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path)
at PowerStoreSentinel.Worker.Watch() in D:\Progetti\PowerStoreSentinel\PowerStoreSentinel\PowerStoreSentinel\PowerStoreSentinel.vb:line 122