📄 untitled2.java~4~
字号:
package test;
import java.net.Socket;
import java.io.OutputStream;
import java.net.InetAddress;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Untitled2 {
public static void main(String[] args) {
Untitled2 untitled2 = new Untitled2();
try
{
Socket s=new Socket("127.0.0.1",8189);
OutputStream outStream=s.getOutputStream();
InetAddress hostAddress=InetAddress.getLocalHost();
String line=hostAddress.getHostName();
byte[] bye=line.getBytes();
outStream.write(bye);
outStream.flush();
s.close();
}catch(Exception ee)
{
System.out.println("客户端出错!");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -