摘要: 1usingSystem; 2usingSystem.Collections.Generic; 3usingSystem.Text; 45usingSystem; 6usingSystem.Data; 7usingSystem.DirectoryServices; 8usingSystem.Collections; 910namespaceIISManage 11{ 12/**////summary 13///IIS管理类,可以实现创建站点、虚拟目录,删除虚拟目录等/// 14////summary 15publicclassIISManager 16{ 1718privatestri 阅读全文
posted @ 2011-01-25 16:13 scgw 阅读(353) 评论(0) 推荐(0) 编辑
摘要: FtpClass.cs:usingSystem;usingSystem.Configuration;usingSystem.IO;usingFtpSupport;usingMicrosoft.Win32;usingSystem.Web;namespaceFtpTest{publicclassFtpClass{privatestringFtpIP=ConfigurationSettings.AppSettings["FtpIP"];privatestringFtpUserName=ConfigurationSettings.AppSettings["FtpUserName"];privatest 阅读全文
posted @ 2011-01-25 14:41 scgw 阅读(676) 评论(0) 推荐(0) 编辑
摘要: 有的时候我们上传东西不想传到web目录而是ftp服务器,这样可以不占用服务器宝贵空间,以前发过一个tips中提到利用ftpsupport.dll操作ftp的方法,可能当时没有说清楚,网友要求给个清楚的例子,就随便写了个文件可以上传,下载,删除ftp上的文件:首先,dll 点击这里 下载,别忘记给项目添加引用test.aspx:%@Pagelanguage="c#"Codebehind="Test.aspx.cs"AutoEventWireup="false"Inherits="FtpTest.Test"%!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Trans 阅读全文
posted @ 2011-01-25 14:40 scgw 阅读(453) 评论(0) 推荐(0) 编辑
摘要: ///summary /// Delete the virtual directory in the WebServer ////summary ///param name="website"webserver name/param ///param name="vdir"virtual directory name/param public static void DeleteVirtualDir(string website, string vdir) { if (!GetVirtualDir(website, vdir)) throw new Exception 阅读全文
posted @ 2011-01-25 14:39 scgw 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 用程序的方法在IIS建立站点或虚拟目录(C#)目的:实现自动建立站点和虚拟目录平台:windows, vs.netpublic class IISHelper { static DirectoryEntry iisDE = new DirectoryEntry("IIS://localhost/W3SVC"); ///summary /// Get The Location IIS WebServers Information ////summary ///returns/returns public static Hashtable GetLocationIIsWebServ 阅读全文
posted @ 2011-01-25 14:38 scgw 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 利用.NET Framework提供的System.DirectoryServices.DirectoryEntry类可以轻松创建IIS站点,并将站点设置为ASP.NET 2.0版本。无疑,这种方法与前面的那个方法相比较,是比较好的。一下代码需要注意的地方是:1,没有做路径检查,这个很简单;2,没有做端口存在的检查,这个也不是很复杂;3,ScriptMapsList数组是为了简单起见,直接从字符串进行分解出来,这个需要注意你自己的应用;4;更多IIS权限处理,可根据需要进行添加。本方法代码如下:string ScriptMaps = @".asp,C:\WINDOWS\system32\ine 阅读全文
posted @ 2011-01-25 09:18 scgw 阅读(499) 评论(0) 推荐(0) 编辑