随笔分类 -  .Net

aspx页面静态化
摘要:IIS设置:站点右键属性,自定义错误,找到404,修改为url,将url设置成/Default.aspx测试一下:随便敲个地址,比如:http://localhost/123.html,应该跳转到Default.aspx然后在Default.aspx中写如下逻辑:View Code 1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (Request.RawUrl.IndexOf(".html") == -1) 4 { 5 ... 阅读全文

posted @ 2012-06-28 14:21 哥是技术人 阅读(366) 评论(0) 推荐(0)

动态修改Windows Service名称
摘要:View Code 1 (1)创建文件:ServiceConfig.txt 2 3 (2)写如下配置: 4 5 ServiceName=DaemonTask1 6 (3)写一个配置类: 7 8 public class Config 9 {10 public static string GetServiceConfig(string key)11 {12 string[] result = { string.Empty };13 string fileName1 = "ServiceConfig.t... 阅读全文

posted @ 2012-05-07 18:00 哥是技术人 阅读(450) 评论(0) 推荐(0)

导航