导航:首页 > IDC知识 > vb访问域名

vb访问域名

发布时间:2020-11-21 20:08:42

1、VB如何远程连接(域名形式) Access数据库,并读取数据库中的某个表,这样来触发程序事件呢???

1.ACCESS是文件型数据来库,不象SQL可以做自成服务器,所以不支持URL访问,只能本机访问。
2.一般访问方法是用ASP(或JSP,PHP等),将库与ASP放在同一服务器中,远程调用ASP,读取本机的ACCESS。

2、如何用VB在IE地址栏中获得域名

Dim WithEvents dWinFolder As ShellWindows

Private Sub Form_Load()

Set dWinFolder = New ShellWindows

InitWindows

End Sub

Private Sub InitWindows()

Timer1.Enabled = True

End Sub

Private Sub Timer1_Timer()
Dim i As Long

Dim objIE As WebBrowser_V1

With txtCode

.Text = ""

For Each objIE In dWinFolder

If objIE.LocationName <> "" Then

i = i + 1
.Text = .Text & vbCrLf & i & ":" & objIE.FullName & "," & "," & Left(objIE.LocationURL, 10)

'//objIE.Refresh2 (7)

End If

Next
'& objIE.Application & ","
'"," & objIE.LocationURL & "," &
End With

Set objIE = Nothing

Timer1.Enabled = False

End Sub

Private Sub dWinFolder_WindowRegistered(ByVal lCookie As Long)

InitWindows

End Sub

Private Sub dWinFolder_WindowRevoked(ByVal lCookie As Long)

InitWindows

End Sub

3、vb win7 text1读取本地连接dns text2dns修改dns域名解析 command1为确定

Const T_NEWDNS1 = "192.168.1.223" 'DNS1
Const T_NEWDNS2 = "180.76.76.76" 'DNS2
strWinMgmt = "winmgmts:{impersonationLevel=impersonate}"
Set NICS = GetObject(strWinMgmt).InstancesOf("Win32_NetworkAdapterConfiguration")

For Each NIC In NICS
If NIC.IPEnabled Then
NIC.SetDNSServerSearchOrder Array(T_NEWDNS1, T_NEWDNS2)
End If
Next

Frame1.Caption = "DNS修改完成"

4、在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

5、关于VB动态IP访问

调用浏览器应该会吧
在label的点击事件里用浏览器浏览"http://" & lblip.caption

不好意思,刚才没用VB试
这回可以了,你用我这个肯定可以了,刚给你写的

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long

Private Sub Label1_Click()
Call ShellExecute(Me.hwnd, "Open", "http://" & Label1.Caption, "", App.Path, 1)
End Sub

6、VB6.0调试一个通过域名获取服务器IP地址的程序时编译器没有提示出错就退出了VB的编辑界面,请问什么原因?

你的代码打错了一些字,请更改为这样

Function GetIP(name As String) As String
'On Error GoTo Err
Dim Hostent_Addr As Long
Dim Host As HOSTENT
Dim HostIP_Addr As Long
Dim temp_IP_Address() As Byte
Dim i As Integer
Dim IP_Address As String
Hostent_Addr = gethostbyname(name)
If Hostent_Addr = 0 Then
GetIP = "主机名不能解析"
Exit Function
End If

RtlMoveMemory Host, Hostent_Addr, LenB(Host)
RtlMoveMemory HostIP_Addr, Host.hAddrList, 4
ReDim temp_IP_Address(1 To Host.hLength)
RtlMoveMemory temp_IP_Address(1), HostIP_Addr, Host.hLength
For i = 1 To Host.hLength
IP_Address = IP_Address & temp_IP_Address(i) & "."
Next
IP_Address = Mid(IP_Address, 1, Len(IP_Address) - 1)
GetIP = IP_Address
End Function

7、VB 根据域名获得IP地址代码的解释

复制内存

8、使用vb怎么查看本机的域名

Dim s As String = Environment.UserDomainName

与vb访问域名相关的知识