Results 1 to 4 of 4

Thread: VB.Net Changing IP Address using Code

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2022
    Posts
    2

    VB.Net Changing IP Address using Code

    Anyone know how to change ip address update folder location & launcher web url using settings.ini to my frmMain?

    My frmMain code

    https://pastebin.pl/view/2fbe8532

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: VB.Net Changing IP Address using Code

    That I don't know, but I can give you coding tips if you like.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2022
    Posts
    2

    Re: VB.Net Changing IP Address using Code

    i would take it

  4. #4
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: VB.Net Changing IP Address using Code

    1. Always declare your variables as "New" or initialize them.
    Private LoginServer As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
    2. Don't user fully qualified references if you can Import the namespace first.
    Imports System.Windows.Forms
    Shared StartPath As String = Application.StartupPath
    3. Consider using hexadecimal numbers when dealing with base two values such as 1024.
    4. The ByVal operator usually isn't necessary in procedure declarations.
    5. Use meaningful variable names. "b" isn't meaningful.
    6. Use the following if/then/else block:
    If LoginServer.Connected Then
    '...Also try avoid using Exit Sub if possible.
    Else
    '...
    End If
    7. Consider using a Select Case block to process "remdata.GetValue(4)".
    8. Use string interpolation instead of string concatenation.
    9. vbNullString is a remnant of classic vb. Use the Nothing keyword.
    10. "While size <> -1 ... End While" could be "Do Until size = -1 ... Loop"
    11. Use MessageBox.Show instead of MsgBox.
    12. Not sure about this one but try using "lineList.First.Remove()" instead of "RemoveAt(0)".
    You'll need to import System.Linq.
    13. I noticed you use Thread.Sleep in some places. I don't like the idea of serious production code just suspending execution like that. You might want to consider some kind of alternative synchronization method.
    14. Don't ever use the End statement to terminate your program! Use Me.Close or Application.Exit. If you feel you need to use the End statement this probably indicates a flaw such as background loop failing to terminate.
    15. "= True" or "= False" are usually unnecessary in expression evaluations. Prefix the expression with the Not operator in the case of "= False".
    16. Try using the Nothing keyword instead of a pair of quotes for empty strings.

    Also, your module is so large it would take a few hours to fully examine so I probably overlooked a few things.

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