2010年10月14日
ServerSocket ss = new ServerSocket(9999);
Socket socket = ss.accept();
InputStreamReader isReader = new InputStreamReader(socket.getInputStream());
BufferedReader reader = new BufferedReader(isReader);
StringBuffer sb = new StringBuffer();
String line;
while((line=reader.readLine())!=null){
sb.append(line);
}
FileWriter fos = new FileWriter("d:/aa.txt",true);
fos.write(sb.toString());
fos.write("\r\n");
fos.close();
socket.close();
ss.close();
out.print(sb.toString()+"<br/>");
客户端代码
Socket socket = new Socket("127.0.0.1",9999);
OutputStreamWriter osWriter = new OutputStreamWriter(socket.getOutputStream());
BufferedWriter writer = new BufferedWriter(osWriter);
double b = Math.random()*10000;
writer.write("发动内容" + b);
writer.close();
socket.close();
把以下内容粘贴到txt文本文件中
regsvr32 /u /s igfxpph.dll
reg delete HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers /f
reg add HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\new /ve /d {D969A300-E7FF-11d0-A93B-00A0C90F2719}
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v HotKeysCmds /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v IgfxTray /f
然后把该txt文本文件后缀名修改为cmd,双击运行即可。