上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 目前很多种类的浏览器中都有代理服务器的设置,用户可以通过浏览器自定义更换自己的IP,实现在线代理翻(河蟹)墙浏览网页。而在.NET中,亦可以通过调用API函数InternetSetOption来实现自定义代理IP的设置。。首先引用System.Runtime.InteropServices名字空间:usingSystem.Runtime.InteropServices;接着引入"wininet.dll"库文件,并定义IP代理设置方法: 1 #region 在线代理 2 public struct Struct_INTERNET_PROXY_INFO 3 { 4 ... 阅读全文
posted @ 2013-07-29 15:05 Lyghost 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 新建一个TextBlock作为最基础的一个控件,他所携带的功能相对于其他的控件要来的比较少,比较值得关注的属性出了布局用的以外和数据绑定意外,就只剩下的Text属性来。TextBlock的默认内容属性是Text。对于换行来说,需要关注的也就是Text和Inline2个属性。常见的TextBlock换行方法1)转义字符换行 在XAML的后台文件中加入代码1 Me.TextBlock1.Text = "AAAAAAA " + vbCrLf + "BBBBBBBB"1 this.TextBlock1.Text = "AAAAAAA/nBBBBBBBB 阅读全文
posted @ 2013-03-19 14:10 Lyghost 阅读(876) 评论(0) 推荐(0) 编辑
摘要: 有的时候我们在对一个引用类型的对象进行传递操作的时候希望不要直接修改传递过来的对象,而是复制出一份来操作的时候就可以用下面的类进行复制using System.IO;using System.Runtime.Serialization;using System.Collections;using System.Collections.Generic;namespace MED.ContactManager.View{ public static class ExtensionMethods { public static T DeepCopy<T>(this T... 阅读全文
posted @ 2013-02-26 15:07 Lyghost 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1 1.由string的rgb数值"255,255,0"转换为color 2 3 { 4 5 //string[] color_params = e.Parameter.ToString().Split(','); 6 //byte color_R = Convert.ToByte(color_params[0]); 7 //byte color_G = Convert.ToByte(color_params[1]); 8 //byte color_B = Con... 阅读全文
posted @ 2012-12-17 23:57 Lyghost 阅读(586) 评论(0) 推荐(0) 编辑
摘要: 1 public static string Md5Sum(string strToEncrypt) 2 { 3 System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding(); 4 byte[] bytes = ue.GetBytes(strToEncrypt); 5 6 // encrypt bytes 7 System.Security.Cryptography.MD5CryptoServiceProvider md... 阅读全文
posted @ 2012-12-16 15:05 Lyghost 阅读(532) 评论(0) 推荐(0) 编辑
摘要: 1、Assembly.LoadFile只载入相应的dll文件,比如Assembly.LoadFile("abc.dll"),则载入abc.dll,假如abc.dll中引用了def.dll的话,def.dll并不会被载入。 Assembly.LoadFrom则不一样,它会载入dll文件及其引用的其他dll,比如上面的例子,def.dll也会被载入。2、用Assembly.LoadFrom载入一个Assembly时,会先检查前面是否已经载入过相同名字的Assembly, 比如abc.dll有两个版本(版本1在目录1下,版本2放在目录2下),程序一开始时载入了版本1,当使用Ass 阅读全文
posted @ 2012-12-07 10:51 Lyghost 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; c 阅读全文
posted @ 2012-12-03 09:07 Lyghost 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 1 public void PositionFile(string sFileFullName) 2 { 3 if (!System.IO.File.Exists(sFileFullName)) return; 4 5 System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe"); 6 //string file = @"c:/windows/notepad.exe"; 7 ... 阅读全文
posted @ 2012-11-10 21:25 Lyghost 阅读(610) 评论(0) 推荐(0) 编辑
摘要: WPF实现的图片保存显示有些不一样,有必要自我总结一下。。。 【注:数据库中保存图片的数据类型最好是varbiary(max)】 1.图片预览功能: 1 private void btn_preview_Click(object sender, RoutedEventArgs e) 2 { 3 OpenFileDialog openfiledialog = new OpenFileDialog(); 4 openfiledialog.Filter = "图片(*.jpg;*.png;*.gif;*.bmp;*.jpeg)|*... 阅读全文
posted @ 2012-11-09 15:07 Lyghost 阅读(860) 评论(0) 推荐(1) 编辑
摘要: 在某些项目中,需要采用控制台程序,但是又不需要通过dos窗口进行交互,同时打算隐藏掉难看的控制台窗口。实现的方法很多,有的是修改链接命令。我采用的方法略有些麻烦,首先是给窗口命名,之后找到该窗口指针,之后再调用winAPI隐藏窗口。程序如下: 1 class Program 2 { 3 [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)] 4 static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow); 5 阅读全文
posted @ 2012-11-08 17:39 Lyghost 阅读(4746) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页