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