code stopping program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • iwdu15

    #1

    code stopping program

    hi, i have the following line of code

    Dim fsUser As New IO.FileStream(S nPath & s.Identity & "\UserData\info .ppf",
    IO.FileMode.Cre ate, IO.FileAccess.W rite)

    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?

    --
    -iwdu15
  • Chris Dunaway

    #2
    Re: code stopping program

    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.

    Comment

    • iwdu15

      #3
      Re: code stopping program

      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.AccS ession, ByVal
      State As AccCoreLib.AccS essionState, ByVal hr As AccCoreLib.AccR esult)
      Handles s.OnStateChange

      Select Case State

      Case AccSessionState .AccSessionStat e_Connecting

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

      Case AccSessionState .AccSessionStat e_Negotiating

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

      Case AccSessionState .AccSessionStat e_Online

      If boolSave Then

      For Each str As String In arrSN

      If Not str = Me.cmbSN.Text Then

      Dim fs As New IO.FileStream(S nPath & s.Identity
      & ".snf", IO.FileMode.Cre ate, IO.FileAccess.W rite)
      Dim sw As New IO.StreamWriter (fs)

      Dim enc As New EncryptAndDecry pt

      sw.WriteLine(Me .cmbSN.Text)
      sw.WriteLine(en c.EncryptString (Me.mtxtpass.Te xt))

      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 EncryptAndDecry pt

      Dim fsUser As New IO.FileStream(S nPath & s.Identity &
      "\UserData\info .ppf", IO.FileMode.Cre ate, IO.FileAccess.W rite)
      Dim swUser As New IO.StreamWriter (fsUser)

      swUser.WriteLin e(enc.EncryptSt ring(Me.mtxtpas s.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 .AccSessionStat e_Validating

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

      Case AccSessionState .AccSessionStat e_Starting

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

      Case AccSessionState .AccSessionStat e_Offline

      Me.tslblStatus. Text = "Offline"

      Me.btnsignon.En abled = True

      Case AccSessionState .AccSessionStat e_Transferring

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

      Case Else

      Me.tslblStatus. Text = State.ToString

      End Select

      End Sub

      --
      -iwdu15

      Comment

      Working...