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
Re: Creating a networking application in VB
this is the code I am using
vb Code:
Imports System
Public Class Form1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Ip As String
Ip = TextBox1.Text
If My.Computer.Network.Ping(Ip) Then
MsgBox("Router Pinged Successfully.")
Else : MsgBox("Ping request timed out.")
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = AxWinsock1.LocalIP
End Sub
End Class
Re: Creating a networking application in VB
It should be included in the install package.
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?
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
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!!
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.
Re: Creating a networking application in VB
Quote:
Originally Posted by
dbasnett
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.
Re: Creating a networking application in VB
Quote:
Originally Posted by
danecook21
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.
Re: Creating a networking application in VB
Quote:
Originally Posted by
dbasnett
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?
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.