我運行下面的代碼:WMI EnableStatic的=類型不匹配
Dim strComputer As String = "."
Dim objWMIService As Object = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Dim colNetAdapters As Object = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration " & "where IPEnabled=TRUE")
Dim ipAdd As String = "83.185.88.205"
Dim ipMask As String = "255.255.255.255"
For Each objNetAdapter In colNetAdapters
If objNetAdapter.Index = 458755 Then
objNetAdapter.EnableStatic(ipAdd, ipMask)
End If
當我運行此我得到行:
objNetAdapter.EnableStatic(IPADD,ipMask)
「類型不匹配」 錯誤代碼
任何想法爲什麼?該接口是由我使用的移動寬帶附帶的軟件建立的PPP接口。
MSDN指定:
UINT32 EnableStatic的( [IN]串的IPAddress [], [IN]串子網掩碼[] );
[in]意味着什麼,我相信我必須以某種方式將變量變成數組?
同樣的問題..不幸 – grandnasty 2011-01-28 14:51:55