code stopping program

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, i have the following line of code

Dim fsUser As New IO.FileStream(SnPath & s.Identity & "\UserData\info.ppf",
IO.FileMode.Create, IO.FileAccess.Write)

in a sub, SnPath is not null, s.identity is not null, and there are no
runtime nor compilation errors. once it hits this line, the code stops
running and my program just acts like nothing happened. its not enclosed in a
try catch block and ive tried closing and reopening the project yet for some
reason it wont work. any ideas?
 
runtime nor compilation errors. once it hits this line, the code stops
running and my program just acts like nothing happened. its not enclosed in a

Can you be more specific? What do you mean when you say "the code
stops running"? What happens if you set a breakpoint at that line and
then step through the code?
try catch block and ive tried closing and reopening the project yet for some
reason it wont work. any ideas?

Can you show us some more code? What you have shown, give very little
information for us to help.
 
yea sorry, what happens is if i step through in debugging mode, is the line
is highlighted in yellow as its supposed to, then when i push the key to step
to the next line (or even to run it without breakpoints) it acts as if there
is no code under it, almost treating that line as an "exit sub". here the
entire method

Private Sub s_OnStateChange(ByVal session As AccCoreLib.AccSession, ByVal
State As AccCoreLib.AccSessionState, ByVal hr As AccCoreLib.AccResult)
Handles s.OnStateChange

Select Case State

Case AccSessionState.AccSessionState_Connecting

Me.tslblStatus.Text = "Connecting..."

Case AccSessionState.AccSessionState_Negotiating

Me.tslblStatus.Text = "Negotiating..."

Case AccSessionState.AccSessionState_Online

If boolSave Then

For Each str As String In arrSN

If Not str = Me.cmbSN.Text Then

Dim fs As New IO.FileStream(SnPath & s.Identity
& ".snf", IO.FileMode.Create, IO.FileAccess.Write)
Dim sw As New IO.StreamWriter(fs)

Dim enc As New EncryptAndDecrypt

sw.WriteLine(Me.cmbSN.Text)
sw.WriteLine(enc.EncryptString(Me.mtxtpass.Text))

fs.Flush()
sw.Flush()

sw.Close()
fs.Close()

End If

Next

End If

If IO.File.Exists(SnPath & s.Identity & "\UserData\") =
False Then

Dim enc As New EncryptAndDecrypt

Dim fsUser As New IO.FileStream(SnPath & s.Identity &
"\UserData\info.ppf", IO.FileMode.Create, IO.FileAccess.Write)
Dim swUser As New IO.StreamWriter(fsUser)

swUser.WriteLine(enc.EncryptString(Me.mtxtpass.Text))

swUser.Close()
fsUser.Close()

End If

frm.Text = Me.cmbSN.Text & "'s Buddy List"

frm.Opacity = 1
frm.Visible = True
frm.Show()

SignOn = s
s = Nothing

Me.Close()

Case AccSessionState.AccSessionState_Validating

Me.tslblStatus.Text = "Validating..."

Case AccSessionState.AccSessionState_Starting

Me.tslblStatus.Text = "Starting..."

Case AccSessionState.AccSessionState_Offline

Me.tslblStatus.Text = "Offline"

Me.btnsignon.Enabled = True

Case AccSessionState.AccSessionState_Transferring

Me.tslblStatus.Text = "Transferring..."

Case Else

Me.tslblStatus.Text = State.ToString

End Select

End Sub
 
Back
Top