大橙子网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

vb.net修改ip vbnet addressof

在vb.net里 ping域名得到ip地址 怎么弄

我来说说...i试试看行不行。Option Explicit

成都创新互联专业为企业提供涟水网站建设、涟水做网站、涟水网站设计、涟水网站制作等企业网站建设、网页设计与制作、涟水企业网站模板建站服务,十年涟水做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

Const SYNCHRONIZE = H100000

Const INFINITE = HFFFF

Const WAIT_OBJECT_0 = 0

Const WAIT_TIMEOUT = H102

Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Sub cmdClear_Click()

txtIP.Text = ""

txtNumber.Text = ""

Open "C:\log.txt" For Output As #1

Close #1

txtOutPut.Text = ""

End Sub

Private Sub cmdPing_Click()

Dim ShellX As String

Dim lPid As Long

Dim lHnd As Long

Dim lRet As Long

Dim VarX As String

frmMain.MousePointer = 11

If txtIP.Text "" Then

DoEvents

ShellX = Shell("command.com /c ping -n " txtNumber.Text " " txtIP.Text " C:\log.txt", vbHide)

lPid = ShellX

If lPid 0 Then

lHnd = OpenProcess(SYNCHRONIZE, 0, lPid)

If lHnd 0 Then

lRet = WaitForSingleObject(lHnd, INFINITE)

CloseHandle (lHnd)

End If

Beep

frmMain.MousePointer = 0

Open "C:\log.txt" For Input As #1

txtOutPut.Text = Input(LOF(1), 1)

Close #1

End If

Else

frmMain.MousePointer = 0

VarX = MsgBox("You have not entered an ip address or the number of times you want to ping.", vbCritical, "Error has occured")

End If

End Sub

VB 修改 IP地地址

你要问的是不是以上三项在注册表中的位置,下面提供:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces

项下有很多句柄你可以在里边找到不同的本地连接对应的句柄,在程序里进行修改就可以了,如果找不到,可以先在本地连接属性里修改tcp/ip协议的相应设置,然后到注册表里查找相应的数据就可以定位该位置了!源码这次就不给出了,就是修改注册表,和容易,您可以使用vb自带的函数,也可以使用wsh提供的脚本函数,当然也可以使用winAPI(比较复杂,要严格定义参数类型,即缓冲区,所以简单的修改不建议使用)。

希望您的问题能尽快解决!

vb.net怎样设置ie浏览器的代理服务器地址

建议你使用注册表的API进行修改

封装两个NET函数给你

private string GetReg(string RegPath)  取得注册表项内容

{

string str="";

RegistryKey hkml = Registry.LocalMachine; 

RegistryKey software = hkml.OpenSubKey("SOFTWARE",true); 

RegistryKey aimdir = software.OpenSubKey("krabs",true);

if (aimdir != null)

{

if (aimdir.GetValue(RegPath) != null)

str = aimdir.GetValue(RegPath).ToString();

if (str != null)

return str;

return null;

}

return null;

}

private bool SetReg(string RegPath,string Data)  //设置注册表内容

{

RegistryKey reg = Registry.LocalMachine;

RegistryKey software = reg.OpenSubKey("SOFTWARE", true);

RegistryKey aimdir1 = software.CreateSubKey("krabs");

if (aimdir1 == null)

return false;

aimdir1.SetValue(RegPath, Data);

return true;

}

如何在vb,net用程序修改ip地址

做exe程序获取本机IP地址用

System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList

做web程序获取客户端的IP地址用

HttpContext.Current.Request.ServerVariables("REMOTE_ADDR"])


网站标题:vb.net修改ip vbnet addressof
转载注明:http://dzwzjz.com/article/dohdehd.html
在线咨询
服务热线
服务热线:028-86922220
TOP