2012年4月26日

C# byte的循环移位

摘要: byte a = 69;//要移位的数字byte n = 1;//移位的数量byte typeLength = 8;//类型的长度,1byte=8bitushort b = a;//当做缓存用的更大的类型b += (ushort)(b << typeLength);//循环左移int result = (byte)(b >> (typeLength - (n % typeLength)));System.Console.Out.WriteLine(result);//循环右移result = (byte)(b >> (n % typeLength));Sys 阅读全文

posted @ 2012-04-26 21:12 wchao911 阅读(2051) 评论(0) 推荐(0) 编辑

WP7 如何禁用WebBrowser 控件缩放和左右移动

摘要: 我认为有两种方法可以实现。1,WebBrowser是基于IE 9的,所以WebBrowser也是支持最新的HTML5标准。然而在HTML中有许多控件是通过Browser的pan和zoom等手持行为起作用的,您可以设置HTML中的viewport metadata元素来实现。如:将下面的HTML代码加入到您的HTML文件头上。<metaname="viewport"content="user-scalable=no"/>2,WebBroswer控件的组成是一棵树型结构如下图:\-WebBrowser \-Border \-Border \-Pa 阅读全文

posted @ 2012-04-26 15:47 wchao911 阅读(244) 评论(1) 推荐(0) 编辑

通过WebClient来获取网络内容

摘要: Thread t = new Thread(new ThreadStart(ProcessWeb));t.Start();private void ProcessWeb(){WebClient wc = new WebClient(); wc.OpenReadCompleted += wcOpenReadCompleted;wc.OpenReadAsync(new Uri("http://www.oschina.net/wp7"));}private void wcOpenReadCompleted(object sender, OpenReadCompletedEvent 阅读全文

posted @ 2012-04-26 14:11 wchao911 阅读(200) 评论(0) 推荐(0) 编辑

导航