编程,软件配置经验积累

/ 技术收藏 / 没有评论 / 564浏览

<1> 可单独运行的jar,获取jar内的图片资源方法,其他资源可以类似获取

ImageIcon favol =new ImageIcon(xx.class.getResource("/xx.jpg"));

<2> c#提交post请求

string postData = "aaa=123&bbb=456";
byte[] data = encoding.GetBytes(postData);
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create(sendURL);
myRequest.Method = "POST";
myRequest.Timeout = 600000;
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();

<3> linux禁ping----无需重启

sysctl -w net.ipv4.icmp_echo_ignore_all=1
sysctl -p