I am using my encryption class from MSDN which has worked so far until this point. The code is below and I either get an error where the DecodeText() part is right now or if I put it in the other areas for the file name, I get no errors but the progress bar doesn't move (line 5 or line 27). Any ideas?
error isvb Code:
Imports Cryptography.clsCrypto Public Class frmSQLExecuteProgress 'specify the location of the dbu file Dim strFileLocation As String = My.Application.Info.DirectoryPath & "\sql\sql.dbu" Private Sub frmSQLExecuteProgress_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'form layout FormLayout(Me) 'start the timer With tmrProgBar .Enabled = True .Interval = 7000 .Start() End With End Sub Private Sub cmdDone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDone.Click 'when the done button is clicked on, close the form Me.Close() End Sub Private Sub tmrProgBar_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrProgBar.Tick With (My.Computer.FileSystem) 'lets see if the file exists If System.IO.File.Exists(strFileLocation) Then 'read all the lines in the file Dim arrDBULineCount() As String = IO.File.ReadAllLines(DecodeText(strFileLocation)) With prgDatabaseExecution 'set the minimum to 0% .Minimum = 0 'set the maximum to 100% .Maximum = 100 'give step the value of the number of lines in the dbu file .Step = CInt(arrDBULineCount.Length.ToString) 'get the incremental by dividing the line count by 100 .Value = CInt(.Step / .Maximum) 'start the progress bar .PerformStep() If .Value = 100 Then 'now that the request has been completed, delete the file IO.File.Delete(strFileLocation) With tmrProgBar .Stop() .Enabled = False 'resize the form With Me .Height = 110 .Width = 300 End With 'show the done button cmdDone.Visible = True End With End If End With End If End With End Sub End Class
An unhandled error has occurred in the application and the error log is attached for resolution assignment.
Message:
Illegal characters in path.
Stack trace:
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.GetFileName(String path)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding)
at System.IO.File.ReadAllLines(String path, Encoding encoding)
at System.IO.File.ReadAllLines(String path)
at BusinessStudio.frmSQLExecuteProgress.tmrProgBar_Tick(Object sender, EventArgs e) in D:\BusinessStudio\frmSQLExecuteProgress.vb:line 29
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)




Reply With Quote