随笔分类 -  .net 1.1

impersonate c#
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System; using System.Security.Principal; using System.Runtime.InteropServices; namespace imper... 阅读全文
posted @ 2008-10-10 16:29 stswordman 阅读(842) 评论(0) 推荐(0) 编辑
使用WMI设置静态ip/使用自动分配ip
摘要:原文出处:http://www.0939.net/Article/it/webteach/200606/227... using System; using System.Management; namespace ArLi.CommonPrj { public class ChangeIP { /// /// Build of ArLi 2003.6.3 /// public static... 阅读全文
posted @ 2007-05-16 10:25 stswordman 阅读(1666) 评论(0) 推荐(0) 编辑
简体中文转换繁体中文
摘要:简体中文和繁体中文的转换 阅读全文
posted @ 2007-04-28 10:43 stswordman 阅读(2452) 评论(11) 推荐(1) 编辑
MulticastDelegate.GetInvocationList()
摘要:class Program{public delegate void myDel();public static event myDel myEvent;static void Main(string[] args){Console.WriteLine(myEvent == null);myEvent += new myDel(Program_myEvent1);myEvent +=new m... 阅读全文
posted @ 2007-04-03 15:04 stswordman 阅读(1292) 评论(4) 推荐(0) 编辑
得到文件的所有者
摘要:using System;using System.IO;using System.Security.AccessControl;using System.Security.Principal;namespace ConsoleApplication2{ class Program { static void Main(string[] args) ... 阅读全文
posted @ 2007-02-14 17:20 stswordman 阅读(284) 评论(0) 推荐(0) 编辑
使用c#建立虚拟目录
摘要:使用c#建立虚拟目录 阅读全文
posted @ 2006-08-05 21:35 stswordman 阅读(2704) 评论(1) 推荐(0) 编辑
正则表达式的字符,定位字符和重复字符
摘要:正则表达式语法表示的字符类 字符类 匹配的字符 示例 \d 从0~9的数字 \d\d可以匹配72,但不能匹配7a或者a7 \D 非数字的字符 \D\D\D可匹配a%c,但不能匹配123 \w 下划线和单词字符 \w\w\w可以匹配a2_,但不能匹配x&a \W 非单词字符和非下划线 \W\W可以匹配&^,但不能匹配a1 \s 空白符,包括了制表符,换行符,回车符,换页符和垂直制表... 阅读全文
posted @ 2006-07-27 14:03 stswordman 编辑
设置自定义服务器控件的TagPrefix
摘要:1 为服务器控件添加ToolboxData属性using System;using System.Web.UI;using System.Web.UI.WebControls;using System.ComponentModel; namespace WebControlLibrary1{ ToolboxData("")] public class WebCustomControl... 阅读全文
posted @ 2006-07-06 22:00 stswordman 阅读(1133) 评论(0) 推荐(0) 编辑
常数中有换行符的错误
摘要:在代码前置时字符串如果包含反斜杠可能会出现"常数中有换行符"的错误,如string str="";解决方法是使用拼接字符串的方法输出字符如下:string str=""; 阅读全文
posted @ 2006-06-26 15:18 stswordman 阅读(807) 评论(0) 推荐(0) 编辑
INFO: HTTP GET and HTTP POST Are Disabled by Default
摘要:http://support.microsoft.com/default.aspx?scid=kb;en-us;819267 INFO: HTTP GET and HTTP POST Are Disabled by Default View products that this article applies to. Article ID ... 阅读全文
posted @ 2006-06-19 23:09 stswordman 阅读(1236) 评论(0) 推荐(0) 编辑
Request.UrlReferrer详解
摘要:Request.UrlReferrer可以获取客户端上次请求的url的有关信息。 这样我们就可以通过这个属性返回到“上一页”,示例如下 1. 首先在Page_load中获得并储存该信息 Page_load(object obj,EventArgs e) { if(!IsPostBack) ... 阅读全文
posted @ 2006-06-12 14:50 stswordman 阅读(25835) 评论(6) 推荐(3) 编辑
Window_Open详解
摘要:引:Window_Open详解一、window.open()支持环境:JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+二、基本语法:window.open(pageURL,name,parameters) 其中:pageURL 为子窗口路径 name 为子... 阅读全文
posted @ 2006-06-02 14:43 stswordman 阅读(404084) 评论(14) 推荐(26) 编辑
c#发送邮件
摘要:需要引用System.Web.Mail命名空间。引用该命名空间需要添加System.Web.Dll MailMessage mail = new MailMessage(); mail.BodyFormat=MailFormat.Html; mail.From ="some@server"; mail.To="some@server";//多个收件人之间用分号分割 mail... 阅读全文
posted @ 2006-05-23 16:39 stswordman 阅读(3362) 评论(4) 推荐(0) 编辑
下载网页后保存为mht格式的文件
摘要:原文http://www.eggheadcafe.com/articles/20040527.asp引入com组件Microsoft Activex Data Object 2.x library和Microsoft CDO For Exchange 2000 libarary具体程序如下. using System; using System.Web; using CDO; using ADOD... 阅读全文
posted @ 2006-05-15 17:19 stswordman 阅读(2053) 评论(2) 推荐(0) 编辑
AD学习--如何获得域中的用户
摘要:代码出自http://www.c-sharpcorner.com//Code/2003/April/ListingADUsers.aspConsole.Write("Enter your Domain Name : ");string dom =Console.ReadLine();System.DirectoryServices.DirectoryEntry entry = new System.DirectoryServices.DirectoryEntry("LDAP://" + dom);System.DirectoryServices.Dire 阅读全文
posted @ 2006-05-10 13:38 stswordman 阅读(1054) 评论(0) 推荐(0) 编辑