Hallo Marmelade
Leider muss ich dich endtäuschen... ich habe erst vor drei Wochen mit C# begonnen.
Google unterstützt mich da sehr xD.
Darum hats auch geklappt.
Es is noch sehr billig aufgebaut aber erfüllt vorerst seinen Zweck. Es gehen einfach 100 Fenster auf welche sich nach ein paar Sekunden wieder schliessen. Mit Ausnahme der IPs auf welchen der Port offen ist.
So siehts aus:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| using System; using ASOCKETLib;
namespace namespace1 { class Class1 { [STAThread] public static void Main(string[] args) { String[] parms = Environment.GetCommandLineArgs(); foreach(string s in parms) { string strHost = "192.168.1."; Tcp objTcp = new Tcp(); SocketConstants objConstants = new SocketConstants(); System.Int32 numPort = 1234; objTcp.Protocol = objConstants.asSOCKET_PROTOCOL_TELNET; strHost = "192.168.1." + s; objTcp.Connect( strHost, numPort ); if( objTcp.LastError == 0 && objTcp.ConnectionState == objConstants.asSOCKET_CONNSTATE_CONNECTED ) { Console.WriteLine( strHost ); string pause; pause = Console.ReadLine(); objTcp.Disconnect(); } } } } } |
Diesem Programm werden nun Parameter übergeben.
Dafür habe ich ne Batch geschrieben...
Quelltext
1: 2: 3: 4: 5: 6: 7: 8:
| @echo off set cnt=1 :start start port.exe %cnt% if %cnt% EQU 100 goto ende set /a cnt="cnt+1" goto start :ende |
Noch intressant wie schnell man die Prozessorauslastung auf 100% kriegt xD