上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 65 下一页
摘要: string[] urilist ={ "http://www.chinanews.com/rss/scroll-news.xml%22,//热点 "http://www.chinanews.com/rss/finance.xml%22,//财经 "http://www.chinanews.com/rss/sports.xml%22,//体育 "http://www.chinanews.com/rss/ent.xml%22,//娱乐 "http://www.chinanews.com/rss/health.xml%22,//健康 "h 阅读全文
posted @ 2011-10-20 10:11 94cool 阅读(227) 评论(0) 推荐(0)
摘要: static Regex _htmlRegex = new Regex("<.*?>", RegexOptions.Compiled); 阅读全文
posted @ 2011-10-20 10:11 94cool 阅读(158) 评论(0) 推荐(0)
摘要: Most Significant Bit, Last(Least) Significant Bit最高有效位(MSB) 指二进制中最高值的比特。在16比特的数字音频中,其第1个比特便对16bit的字的数值有最大的影响。例如,在十进制的15,389这一数字中,相当于万数那1行(1)的数字便对数值的影响最大。比较与之相反的“最低有效位”(LSB)。MSB高位前导,LSB低位前导。谈到字节序的问题,必然牵涉到两大CPU派系。那就是Motorola的PowerPC系列CPU和Intel的x86系列CPU。PowerPC系列采用bigendian方式存储数据,而x86系列则采用littleendian方 阅读全文
posted @ 2011-09-25 21:04 94cool 阅读(319) 评论(0) 推荐(0)
摘要: 除了点对点,通常UDP数据的传递方式有两种,一种是BroadCast,一种是MultiCast。中文一般把它们翻译作广播和组播。前者是简单的在局域网里面广播;后者是借助路由器将数据发送到包括英特网在内的任何多个地址。在C#里面,处理UDP通讯最简单的方法就是使用UdpClient。具体使用方法我也不赘述了,在msdn上就有。需要注意的问题有:1、UDP通讯在发送的时候可以绑定任何本地端口,但是在接收的时候需要在本地绑定广播或者多播端口。2、组播的时候发送和接收双方都需要JoinMulticastGroup。参数timeToLive名字很容易让人误会,其实它指的是允许UDP数据穿过几个路由器(当 阅读全文
posted @ 2011-09-03 21:05 94cool 阅读(1269) 评论(0) 推荐(0)
摘要: 服务器端:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Net;usingSystem.Net.Sockets;namespaceUDPServer{classProgram{staticvoidMain(string[]args){intrecv;byte[]data=newbyte[1024] 阅读全文
posted @ 2011-09-03 21:04 94cool 阅读(642) 评论(0) 推荐(0)
摘要: private void createdir() { string uri = "ftp://127.0.0.1/test/; if (!Directory.Exists(uri)) { FtpWebRequest frequest = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); frequest.Credentials = new NetworkCredential(user, pwd); frequest.Method = WebRequestMethods.Ftp.MakeDirectory; try { FtpWebR 阅读全文
posted @ 2011-09-03 00:11 94cool 阅读(2021) 评论(1) 推荐(0)
摘要: from:http://blog.csdn.net/camel_flying/article/details/6056910一、长连接与短连接:长连接:client方与server方先建立连接,连接建立后不断开,然后再进行报文发送和接收。这种方式下由于通讯连接一直存在。此种方式常用于P2P通信。短连接:Client方与server每进行一次报文收发交易时才进行通讯连接,交易完毕后立即断开连接。此方式常用于一点对多点通讯。C/S通信。二、长连接与短连接的操作过程:短连接的操作步骤是:建立连接——数据传输——关闭连接...建立连接——数据传输——关闭连接长连接的操作步骤是:建立连接——数据传输.. 阅读全文
posted @ 2011-08-31 20:45 94cool 阅读(297) 评论(0) 推荐(0)
摘要: public object DeCompress(string fileName) { object obj = null; try { using (Stream source = File.OpenRead(fileName)) { using (Stream destination = new MemoryStream()) { using (GZipStream input = new GZipStream(source, CompressionMode.Decompress, true)) { byte[] bytes = new byte[4096]; int n; while ( 阅读全文
posted @ 2011-08-30 09:41 94cool 阅读(275) 评论(0) 推荐(0)
摘要: 获取valueforeach (Student ss in stu.Values){ MessageBox.Show(ss.Name.ToString()); } ***********************************************获取keyforeach (string key in stu.Keys) { MessageBox.Show(key);} }****************获取key、valueforeach (KeyValuePair<string, Class1> a in cl) { if (a.Key == s1.Name) Mes 阅读全文
posted @ 2011-08-24 09:49 94cool 阅读(5173) 评论(0) 推荐(0)
摘要: 生成:<?xml version="1.0" encoding="utf-8"?><CategoryList><Category ID="01"><MainCategory>XML</MainCategory><Description>This is a list my XML articles.</Description><Active>true</Active></Category></CategoryLi 阅读全文
posted @ 2011-08-24 09:39 94cool 阅读(205) 评论(0) 推荐(0)
上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 65 下一页