摘要: static class Util { /// <summary> /// 16位字节序调整 /// </summary> /// <param name="v"></param> /// <returns></returns> public static UInt16 swap16(UInt16 v) { return (UInt16)(((v & 0x00ff) << 8) | ((v & 0xff00) >> 8)); } /// <summary&g 阅读全文
posted @ 2011-05-28 23:36 OYJJ 阅读(558) 评论(0) 推荐(0) 编辑
摘要: string->byte[]Encoding.Default.GetBytesbyte[]->stringEncoding.Default.GetString例如:Byte[] bytes = { 0x31, 0x32 };string str = Encoding.Default.GetString(bytes);bytes = Encoding.Default.GetBytes(str);编码可选择,Encoding.UTF8Encoding.ASCII 等等,根据实际情况选取。 阅读全文
posted @ 2011-05-28 23:25 OYJJ 阅读(188) 评论(0) 推荐(0) 编辑
摘要: HttpWebRequest 使用示例: public partial class Form1 : Form { private HttpWebRequest request; private HttpWebResponse response; public Form1() { InitializeComponent(); } private void btnGo_Click(object sender, EventArgs e) { try { request = (HttpWebRequest)HttpWebRequest.Create(txtUrl.Text); response = ( 阅读全文
posted @ 2011-05-28 22:51 OYJJ 阅读(543) 评论(0) 推荐(0) 编辑