C# 操作iis6、iis7 301
2015-08-30 15:51
363 查看
iis6版本方法。。。
iis7以及以上版本方法
iis7以及以上版本方法
using (ServerManager serverManager = new ServerManager()) { Configuration config = serverManager.GetWebConfiguration("http301"); ConfigurationSection httpRedirectSection = config.GetSection("system.webServer/httpRedirect"); httpRedirectSection["enabled"] = true; httpRedirectSection["destination"] = @"http://www.crcz.cn"; httpRedirectSection["exactDestination"] = true; httpRedirectSection["httpResponseStatus"] = @"Permanent"; serverManager.CommitChanges(); }
相关文章推荐
- 扫雷游戏 C#
- C#生成时间戳
- C# NotifyIcon实现单击左键也弹出菜单的方法
- C#对字符串加密解密
- c#中怎样给textbox添加背景图片
- C#图片压缩方法
- C#生成唯一值的方法汇总
- C#中怎么复制数组
- C# 插件开发
- C# string类型和byte[]类型相互转换
- BC#53 1001 Rikka with Graph
- C#中的delegate与event简单讲解
- C#中堆和栈的区别分析
- C#基础案例------聊天机器人
- c#之内置类型
- C# WindowsEvent Select
- c# TextBox只允许输入数字,禁用右键粘贴,允许Ctrl+v粘贴数字
- C# - 委托的使用
- c#输出文件对话框
- c#格式化数字