Results 1 to 11 of 11

Thread: Creating a networking application in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    4

    Creating a networking application in VB

    Hi,
    I am new to vb and having a bit of trouble creating a little application. I want to be able to retrieve the local ip address and then be able to ping it. It works perfectly when using the form or when I execute it on the computer with vb 2008 installed. When I first built the application I needed to install mswinsck.ocx to the system.32 folder and was having problems on windows 7. I finally got it to work. It gave me an error but it seems to be working fine.

    Problem:
    When I install the application on another computer windows gives me the error that the application has stopped working and thats as far as it will go. what I want to know is will i need to install mswinsck.ocx on all the computers I want it to run on or can I include it in the install package? if not is there another way I can retrieve the localIP without using winsock so it will run on other computers?

    any help would be greatly appreciated . Thank you

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    4

    Re: Creating a networking application in VB

    this is the code I am using

    vb Code:
    1. Imports System
    2. Public Class Form1
    3.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    4.  
    5.  
    6.         Dim Ip As String
    7.         Ip = TextBox1.Text
    8.         If My.Computer.Network.Ping(Ip) Then
    9.             MsgBox("Router Pinged Successfully.")
    10.         Else : MsgBox("Ping request timed out.")
    11.         End If
    12.     End Sub
    13.  
    14.  
    15.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    16.  
    17.         TextBox1.Text = AxWinsock1.LocalIP
    18.     End Sub
    19. End Class

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Creating a networking application in VB

    It should be included in the install package.

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    4

    Re: Creating a networking application in VB

    sorry for the noob question but how do i go about doing that? do I just drop it into the folder with all the files? the mswinsck.ocx needs to be registered e.g regsvr32 c:\windows\system32\mswinsck.ocx. It seems to work on other pcs with mswinsck installed. would it be best to create a script or something to automatically install the mswinsck.ocx and register it before installing the application on another computer?

  5. #5
    New Member
    Join Date
    Apr 2010
    Posts
    13

    Re: Creating a networking application in VB

    I know there HAS to be a way to copy the OCX file to the system32 directory -- but let me ask, why is your program looking there? if you make an installer, it should extract it all to one folder, where your program can "archive" it from/to

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    4

    Re: Creating a networking application in VB

    Hey Teh_VB_Helper,
    Thanks for your comment sorry for the late reply, I have a program completed in Vb and it uses the mswinsck.ocx to ping the local ip address of the machine using the application. I have no idea how to go about creating an installer. should the installer automatically add that file to it or what? I appreciate ur help. a noob guide would be the business!!

  7. #7
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Creating a networking application in VB

    What do you think this statement does

    TextBox1.Text = AxWinsock1.LocalIP

    As long as you take the default settings in the build, you shouldn't need to install anything on the users PC.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  8. #8
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: Creating a networking application in VB

    Quote Originally Posted by dbasnett View Post
    What do you think this statement does

    TextBox1.Text = AxWinsock1.LocalIP

    As long as you take the default settings in the build, you shouldn't need to install anything on the users PC.
    That is not true at all. Couple things. If you're using .NET then of course the framework must be installed. Second, since you are using .NET, you should be using the Sockets class, not the mswinsck control. However, it is true that any ocx or dll that your app uses will need to be installed and registered on the user's system. That's what an installer is for. There are tons of freeware or shareware packaging apps available. .NET has the deployment project for this purpose.

  9. #9
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Creating a networking application in VB

    Quote Originally Posted by danecook21 View Post
    That is not true at all. Couple things. If you're using .NET then of course the framework must be installed. Second, since you are using .NET, you should be using the Sockets class, not the mswinsck control. However, it is true that any ocx or dll that your app uses will need to be installed and registered on the user's system. That's what an installer is for. There are tons of freeware or shareware packaging apps available. .NET has the deployment project for this purpose.
    I was speaking of AxWinsock1. You are of course correct.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  10. #10
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: Creating a networking application in VB

    Quote Originally Posted by dbasnett View Post
    I was speaking of AxWinsock1. You are of course correct.
    I was referring to this comment: "As long as you take the default settings in the build, you shouldn't need to install anything on the users PC." Maybe I misunderstood?

  11. #11
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Creating a networking application in VB

    I did not mean to imply that nothing would be installed. I have already agreed that you have made the correct statement. I made a blanket statement when what I meant only referred to mswinsck.ocx, which is not needed at all to do a ping.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

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