Do you check the function return values?This is the info from MSDN:The SetComputerName function stores a new NetBIOS name for the local computer. The name is stored in the registry and takes effect the next time the user restarts the computer. If the local computer is a node in a cluster, SetComputerName sets NetBIOS name of the local computer, not that of the cluster. Windows 2000: To set the DNS host name or the DNS domain name, call the SetComputerNameEx function.
俄找到的api,不行别怪我 ^_^] 【操作系统】 Win9X:Yes WinNT:Yes 【说明】 设置新的计算机名 【返回值】 Long,非零表示成功,零表示失败。会设置GetLastError 【其它】 windows95会将任何非法字符自动转换到标准的字符集里。windows nt则会报告出错 【参数表】 lpComputerName - String,新的计算机名称。最多可有MAX_COMPUTERNAME_LENGTH个字符Private Declare Function SetComputerName Lib "kernel32" Alias "SetComputerNameA" (ByVal lpComputerName As String) As Long Private Sub Form_Load() Dim sNewName As String sNewName = InputBox("Please enter a new computer name.") SetComputerName sNewName MsgBox "Computername set to " + sNewName End Sub
return 1, it should succeed. (搞不定.NET)
问题是-----的确无效 不信您在Win2k下试试
so, i say: 搞不定.NEThehe
摆脱,我阅读理解一向得分不高 您的 So 代表的是Me too ,还是 Success ? 我现在在线等呀
而且重新启动还是不变
更改网络标识使用SetComputerName对么?
(还得从专家门诊进)
是系统出现了问题,还是CSDN本来就这样?
俄找到的api,不行别怪我 ^_^]
【操作系统】
Win9X:Yes
WinNT:Yes
【说明】
设置新的计算机名
【返回值】
Long,非零表示成功,零表示失败。会设置GetLastError
【其它】
windows95会将任何非法字符自动转换到标准的字符集里。windows
nt则会报告出错
【参数表】
lpComputerName - String,新的计算机名称。最多可有MAX_COMPUTERNAME_LENGTH个字符Private Declare Function SetComputerName Lib "kernel32" Alias "SetComputerNameA" (ByVal lpComputerName As String) As Long
Private Sub Form_Load()
Dim sNewName As String
sNewName = InputBox("Please enter a new computer name.")
SetComputerName sNewName
MsgBox "Computername set to " + sNewName
End Sub
(搞不定.NET)
不信您在Win2k下试试
您的 So 代表的是Me too ,还是 Success ?
我现在在线等呀
setcomputername 更改的computername 是环境变量里面的LOGONSERVER=\\Text1
COMPUTERNAME=Text1
网络标识看来不是用Setcomputername改的
==========================
问题来了:怎么改网络标识?
这才是我的目的
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet004\Control\ComputerName\ComputerName\ComputerNameHKEY_LOCAL_MACHINE\SYSTEM\ControlSet004\Services\Tcpip\Parameters\NV HostnameHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerNameHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV Hostname可能还需要改其他的地方,你用regshot自己比较一下吧。