有代码最好,给点提示也给分,谢谢

解决方案 »

  1.   

    参考:
    http://www.vckbase.com/document/viewdoc.asp?id=851主要是先用api函数修改注册表,然用DhcpNotifyConfigChange通知配置的改变上面的程序适用于WINDOWS NT/2000/XP/2003在win98下要先用api在注册表中修改IP地址,然后禁用/使用网卡使之生效(禁用/使用网卡之间要间隔1-2分钟,速度不是很快)。
      

  2.   

    修改注册表!!!如果要VB代码,请跟我联系[email protected]
    :)
    代码之多,我无法显示出来..呵呵!
      

  3.   

    编程实现windows2000下的网络连接的启用和禁用
    转载 (程序太平洋 by hanlin)
    看能不能改成win98的。Private Sub ToggleLanConnection()
        Const ssfCONTROLS = 3
        
        sConnectionName = "本地连接"
    '    sConnectionName = "Local Area Connection" '英文
        
        sEnableVerb = "启用(&A)"
        sDisableVerb = "禁用(&B)"
    '    sEnableVerb = "En&able"  '英文
    '    sDisableVerb = "Disa&ble" '英文
        
        Set shellApp = CreateObject("shell.application")
        Set oControlPanel = shellApp.Namespace(ssfCONTROLS)
        
        Set oNetConnections = Nothing
        For Each folderitem In oControlPanel.items
          If folderitem.Name = "网络和拨号连接" Then
    '      If folderitem.Name = "Network Connections" Then '英文
            Set oNetConnections = folderitem.getfolder: Exit For
          End If
        Next
        
        If oNetConnections Is Nothing Then
          MsgBox "Couldn't find 'Network Connections' folder"
          Exit Sub
        End If
        
        Set oLanConnection = Nothing
        For Each folderitem In oNetConnections.items
          If LCase(folderitem.Name) = LCase(sConnectionName) Then
            Set oLanConnection = folderitem: Exit For
          End If
        Next
        
        If oLanConnection Is Nothing Then
          MsgBox "Couldn't find '" & sConnectionName & "' item"
          Exit Sub
        End If
        
        bEnabled = True
        Set oEnableVerb = Nothing
        Set oDisableVerb = Nothing
        For Each Verb In oLanConnection.verbs
          Debug.Print Verb.Name
          If Verb.Name = sEnableVerb Then
            Set oEnableVerb = Verb
            bEnabled = False
            Exit For
          End If
          If Verb.Name = sDisableVerb Then
            Set oDisableVerb = Verb
            Exit For
          End If
        Next
        
        If bEnabled Then
          oDisableVerb.DoIt
        Else
          oEnableVerb.DoIt
        End IfEnd Sub
    Private Sub Command1_Click()
        ToggleLanConnection
    End Sub
      

  4.   

    对于我写得那段代码,我要说明一下。我曾经把它修改为 启用和禁用 win2003下的宽带连接。估计也可以改成win98的。其实就是模拟按钮而已。
    模拟了右键菜单。