Announcement

Collapse
No announcement yet.

Lan Verbindung deakt/aktiv

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lan Verbindung deakt/aktiv

    Weis jemand wie man Programmgesteuert unter Windows 2000 die Lan Verbindung kurz deaktiviert und wieder aktiviert. Danke fuer eure Hilfe.

  • #2
    Hallo,
    das wüsste ich auch gerne. Ich habe zur Zeit ein LAN Problem unter Win2000. Durch kurzes deaktivieren und wieder aktivieren ist das Problem weg. Könnte ich dies mit Delphi wäre mein Problem gelöst.
    Hast du etwa ein ähnliches Problem ?
    Wenn du eine Lösung hast las es mich bitte wissen

    Comment


    • #3
      Hat denn schon jemand eine Lösung für dieses Problem? Ich stehe momentan vor dem selben Problem

      Comment


      • #4
        Niemand hier im Forum der wenigstens einen ansatz für eine Lösung hat

        Comment


        • #5
          Hallo,<br>teste doch mal mit NETSH<br><br>
          <p class=MsoNormal>@ECHO OFF</p>

          <p class=MsoNormal>ECHO *** INTERNET AKTIVIEREN ***</p>

          <p class=MsoNormal>REM INTERNET EINSCHALTEN</p>

          <p class=MsoNormal>netsh interface ip set address
          name=&quot;LAN-Verbindung&quot; source=dhcp </p>

          <p class=MsoNormal>netsh interface ip set dns name=&quot;LAN-Verbindung&quot;
          source=static addr=192.168.1.1</p>

          <p class=MsoNormal>netsh interface ip add dns name=&quot;LAN-Verbindung&quot;
          addr=192.168.1.2</p>

          <p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o></o></p>
          <br>
          <p class=MsoNormal>@ECHO OFF<o></o></p>

          <p class=MsoNormal>ECHO *** INTERNET DEAKTIVIEREN ***<o></o></p>

          <p class=MsoNormal>REM INTERNET ABSCHALTEN DURCH FALSCHEN GATEWAY<o></o></p>

          <p class=MsoNormal>netsh interface ip set address
          name=&quot;LAN-Verbindung&quot; source=dhcp<o></o></p>

          <p class=MsoNormal>netsh interface ip set dns name=&quot;LAN-Verbindung&quot;
          source=static addr=192.168.1.253<o></o></p>

          <p class=MsoNormal>netsh interface ip add dns name=&quot;LAN-Verbindung&quot;
          addr=192.168.1.254</p>
          <br>"LAN-VERBINDUNG" musst du deinem Eintrag in Netzwerkverbindungen anpassen! (Die IP natürlich auch!)<br>Die beiden "Teile" jeweils in eine Datei mit endung .cmd reinkopieren und dann einfach anklicken.<br><br>Michael<br><br><b>Ich habe mal NEOBROTHERS besucht... Wo kann man den Source von RACEKING bekommen ??? <br>Kannst du mir den zumailen? [email protected]

          Comment


          • #6
            Hallo, nach langer suche habe ich das hier gefunden
            <PRE>
            ' Switch Boolean (Scope: form or module level)
            Dim LANEnable As Boolean = True

            ' ***** Either placed within a button or routine *****

            ' Control Panel Identifier
            Const ssfCONTROLS = 3

            ' Enter the name of the connection to manipulate
            Dim ConnectionName As String = "Local Area Connection"
            Dim EnableVerb As String = "En&able"
            Dim DisableVerb As String = "Disa&ble"

            ' Generate Shell item
            Dim ShellApp As New Shell32.Shell()
            ' Obtain the CP
            Dim ControlPanel As Shell32.Folder = ShellApp.NameSpace(ssfCONTROLS)
            Dim FolderItem As Shell32.FolderItem
            Dim NetworkFolder As Shell32.Folder
            Dim LANConnection As Shell32.FolderItem

            ' Loop through the items in the control panel and obtain the Network Connections folder
            For Each FolderItem In ControlPanel.Items()
            Debug.WriteLine("Loop 1: " & FolderItem.Name)
            If FolderItem.Name = "Network Connections" Then
            ' When found - exit the loop
            NetworkFolder = FolderItem.GetFolder
            Exit For
            End If
            Next

            ' Debug check
            If NetworkFolder Is Nothing Then
            MessageBox.Show("Error - No network folder found")
            Exit Sub
            End If

            ' Obtain the appropriate connection record
            For Each FolderItem In NetworkFolder.Items()
            Debug.WriteLine("Loop 2: " & FolderItem.Name)
            If FolderItem.Name = ConnectionName Then
            ' When found - exit the loop
            LANConnection = FolderItem
            Exit For
            End If
            Next

            ' Debug check
            If LANConnection Is Nothing Then
            MessageBox.Show("Error - No LAN entry was not found")
            Exit Sub
            End If

            ' Swtich the LAN toggle
            LANEnable = Not LANEnable

            Dim EnableVerbItem, DisableVerbItem, Verb As Shell32.FolderItemVerb

            ' Run through all available options and obtain the appropriate action
            For Each Verb In LANConnection.Verbs
            Debug.WriteLine("Loop 3: " & Verb.Name)
            If Verb.Name = EnableVerb Then
            EnableVerbItem = Verb
            End If
            If Verb.Name = DisableVerb Then
            DisableVerbItem = Verb
            End If
            Next

            ' Perform the enable / disable
            If LANEnable Then
            EnableVerbItem.DoIt()
            Else
            DisableVerbItem.DoIt()
            End If
            </PRE>
            Bin gerade dabei zu versuchen das irgendwie in Delphi umzusetzen. aber irgendwie wills noch net.. wenn jemand helfen kann wärs net schlecht ;

            Comment


            • #7
              Hallo, also ich bekomm den Code garnicht zum laufen. Mir fehlt da irgendwo der Ansatz. Hat es denn jemand anders mal versucht

              Comment

              Working...
              X