Results 1 to 3 of 3

Thread: Executing lines twice !!!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Location
    fgh
    Posts
    332

    Executing lines twice !!!

    Hello techs,

    I have problem in one of my test project... i am developing a client server project in C# using telnet server.

    In some parts of code ... the lines are working twice ....

    suppose :
    string sRecieved = Encoding.ASCII.GetString( m_byBuff, 0, nBytesRec );

    using F11 to debug the issue ... the above line will get the execution control and after execution, normally it need to go to next line for execution, but here by pressing F11, the same line will get the control and executes once more ... ????

    I am not using any thread or timers .... I am using sockets for doing this ...

    if any clarifications needed, please ask ...

    thankzzzz
    gh

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Executing lines twice !!!

    F11 is for stepping into a method. If there's no method to step into then it should step to the next line, so what you're saying does seem strange, but if there's no method to step into then why use F11 at all? F10 specifically steps to the next line, so try using it and see if that line still gets executed twice.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Executing lines twice !!!

    Also, if this code is in an event handler, make sure you haven't assigned the event twice. I have seen this happen when you manually add the event in code (obj.Event += MyHandler(...)) and when the event handler has the handles keyword after its definition (void MyHandler(...) Handles obj.Event).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width