当前位置: 首页>>代码示例>>C#>>正文


C# Web.WebVirtualDirectory类代码示例

本文整理汇总了C#中WebsitePanel.Providers.Web.WebVirtualDirectory的典型用法代码示例。如果您正苦于以下问题:C# WebVirtualDirectory类的具体用法?C# WebVirtualDirectory怎么用?C# WebVirtualDirectory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WebVirtualDirectory类属于WebsitePanel.Providers.Web命名空间,在下文中一共展示了WebVirtualDirectory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindWebItem

        public void BindWebItem(WebVirtualDirectory item)
        {
            IIs7 = item.IIs7;

            // bind data
            gvErrorPages.DataSource = item.HttpErrors;
            gvErrorPages.DataBind();
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:8,代码来源:WebSitesCustomErrorsControl.ascx.cs

示例2: BindWebItem

        public void BindWebItem(int packageId, WebVirtualDirectory item)
        {
            fileLookup.PackageId = item.PackageId;
            fileLookup.SelectedFile = item.ContentPath;

            string resSuffix = item.IIs7 ? "IIS7" : "";

            chkRedirectExactUrl.Text = GetLocalizedString("chkRedirectExactUrl.Text" + resSuffix);
            chkRedirectDirectoryBelow.Text = GetLocalizedString("chkRedirectDirectoryBelow.Text" + resSuffix);
            chkRedirectPermanent.Text = GetLocalizedString("chkRedirectPermanent.Text" + resSuffix);

            chkRedirectExactUrl.Checked = item.RedirectExactUrl;
            chkRedirectDirectoryBelow.Checked = item.RedirectDirectoryBelow;
            chkRedirectPermanent.Checked = item.RedirectPermanent;

            chkDirectoryBrowsing.Checked = item.EnableDirectoryBrowsing;
            chkParentPaths.Checked = item.EnableParentPaths;
            chkWrite.Checked = item.EnableWritePermissions;

            chkDedicatedPool.Checked = item.DedicatedApplicationPool;
            chkDedicatedPool.Enabled = !item.SharePointInstalled;

            chkAuthAnonymous.Checked = item.EnableAnonymousAccess;
            chkAuthWindows.Checked = item.EnableWindowsAuthentication;
            chkAuthBasic.Checked = item.EnableBasicAuthentication;

            // default documents
            txtDefaultDocs.Text = String.Join("\n", item.DefaultDocs.Split(',', ';'));

            // redirection
            txtRedirectUrl.Text = item.HttpRedirect;
            bool redirectionEnabled = !String.IsNullOrEmpty(item.HttpRedirect);
            rbLocationFolder.Checked = !redirectionEnabled;
            rbLocationRedirect.Checked = redirectionEnabled;
            valRedirection.Enabled = redirectionEnabled;

            // store app pool value
            ViewState["ApplicationPool"] = item.ApplicationPool;

            ToggleLocationControls();

            // toggle controls by quotas
            fileLookup.Enabled = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_HOMEFOLDERS);
            rbLocationRedirect.Visible = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_REDIRECTIONS);
            bool customSecurity = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_SECURITY);
            chkWrite.Visible = customSecurity;
            // hide authentication options if not allowed
            pnlCustomAuth.Visible = customSecurity;
            //
            chkDedicatedPool.Visible = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_APPPOOLS);
            pnlDefaultDocuments.Visible = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_DEFAULTDOCS);

            
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:54,代码来源:WebSitesHomeFolderControl.ascx.cs

示例3: BindWebItem

        public void BindWebItem(int packageId, WebVirtualDirectory item)
        {
            // IIS 7.0 mode
            IIs7 = item.IIs7;

            chkAsp.Checked = item.AspInstalled;
            Utils.SelectListItem(ddlAspNet, item.AspNetInstalled);
            Utils.SelectListItem(ddlPhp, item.PhpInstalled);
            chkPerl.Checked = item.PerlInstalled;
            chkPython.Checked = item.PythonInstalled;
            chkCgiBin.Checked = item.CgiBinInstalled;
            
            // toggle controls by quotas
            rowAsp.Visible = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_ASP);

            // IIS 7 does not support web sites w/o ASP.NET, so do we
			if (IIs7)
				ddlAspNet.Items.Remove(ddlAspNet.Items.FindByValue(""));
            
            // asp.net
			if (!PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_ASPNET11))
                ddlAspNet.Items.Remove(ddlAspNet.Items.FindByValue("1"));

            if (!PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_ASPNET20))
                ddlAspNet.Items.Remove(ddlAspNet.Items.FindByValue("2"));

			if (!PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_ASPNET40))
				ddlAspNet.Items.Remove(ddlAspNet.Items.FindByValue("4"));

            if (!IIs7 || !PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_ASPNET20))
                ddlAspNet.Items.Remove(ddlAspNet.Items.FindByValue("2I"));

			if (!IIs7 || !PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_ASPNET40))
				ddlAspNet.Items.Remove(ddlAspNet.Items.FindByValue("4I"));

            rowAspNet.Visible = ddlAspNet.Items.Count > 1;

            // php
            if (!PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_PHP4))
                ddlPhp.Items.Remove(ddlPhp.Items.FindByValue("4"));
            if (!PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_PHP5))
                ddlPhp.Items.Remove(ddlPhp.Items.FindByValue("5"));
            rowPhp.Visible = ddlPhp.Items.Count > 1;

            rowPerl.Visible = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_PERL);
            rowCgiBin.Visible = PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_CGIBIN);

			// Left Python support along IIS 7
			rowPython.Visible = !IIs7 && PackagesHelper.CheckGroupQuotaEnabled(packageId, ResourceGroups.Web, Quotas.WEB_PYTHON);
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:50,代码来源:WebSitesExtensionsControl.ascx.cs

示例4: BindWebItem

        public void BindWebItem(WebVirtualDirectory item)
        {
            IIs7 = item.IIs7;

            // bind error mode
            ddlErrorMode.Items.Add(HttpErrorsMode.DetailedLocalOnly.ToString());
            ddlErrorMode.Items.Add(HttpErrorsMode.Custom.ToString());
            ddlErrorMode.Items.Add(HttpErrorsMode.Detailed.ToString());

            ddlErrorMode.SelectedValue = item.ErrorMode.ToString();
            
            // bind errors list
            gvErrorPages.DataSource = item.HttpErrors;
            gvErrorPages.DataBind();
        }
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:15,代码来源:WebSitesCustomErrorsControl.ascx.cs

示例5: ToggleWmSvcControls

		private void ToggleWmSvcControls(WebVirtualDirectory item)
		{
			if (!item.GetValue<bool>(WebVirtualDirectory.WmSvcAvailable))
			{
				pnlWmcSvcManagement.Visible = false;
				pnlNotInstalled.Visible = true;
				//
				return;
			}
			//
			pnlWmcSvcManagement.Visible = true;
			pnlNotInstalled.Visible = false;

			//
			string wmSvcAccountName = item.GetValue<string>(WebVirtualDirectory.WmSvcAccountName);
			bool wmcSvcSiteEnabled = item.GetValue<bool>(WebVirtualDirectory.WmSvcSiteEnabled);

			btnWmSvcSiteEnable.Visible = true;
			txtWmSvcAccountName.Visible = true;

			//
			txtWmSvcAccountPassword.Text = txtWmSvcAccountPassword.Attributes["value"] = String.Empty;
			//
			txtWmSvcAccountPasswordC.Text = txtWmSvcAccountPasswordC.Attributes["value"] = String.Empty;

			// Disable edit mode if WmSvc account name is set
			if (wmcSvcSiteEnabled)
			{
				btnWmSvcSiteEnable.Visible = false;
				txtWmSvcAccountName.Visible = false;

				//
				txtWmSvcAccountPassword.Text = PasswordControl.EMPTY_PASSWORD;
				txtWmSvcAccountPassword.Attributes["value"] = PasswordControl.EMPTY_PASSWORD;

				//
				txtWmSvcAccountPasswordC.Text = PasswordControl.EMPTY_PASSWORD;
				txtWmSvcAccountPasswordC.Attributes["value"] = PasswordControl.EMPTY_PASSWORD;
			}

			//
			litWmSvcAccountName.Visible = wmcSvcSiteEnabled;
			btnWmSvcSiteDisable.Visible = wmcSvcSiteEnabled;
			btnWmSvcChangePassw.Visible = wmcSvcSiteEnabled;
			pnlWmSvcSiteDisabled.Visible = !wmcSvcSiteEnabled;
			pnlWmSvcSiteEnabled.Visible = wmcSvcSiteEnabled;

			//
			txtWmSvcAccountName.Text = wmSvcAccountName;
			litWmSvcAccountName.Text = wmSvcAccountName;
		}
开发者ID:jordan49,项目名称:websitepanel,代码行数:51,代码来源:WebSitesEditSite.ascx.cs

示例6: BindWebPublishingProfileFtpAccounts

		private void BindWebPublishingProfileFtpAccounts(WebVirtualDirectory item)
		{
			var ftpAccounts = ES.Services.FtpServers.GetFtpAccounts(PanelSecurity.PackageId, false);
			//
			MyFtpAccountList.DataSource = Array.FindAll(ftpAccounts, x => x.Folder.Equals(item.ContentPath));
			MyFtpAccountList.DataBind();
			//
			MyFtpAccountList.Items.Insert(0, new ListItem(GetLocalizedString("WebPublishing.ChooseFtpAccountPrompt"), String.Empty));
		}
开发者ID:jordan49,项目名称:websitepanel,代码行数:9,代码来源:WebSitesEditSite.ascx.cs

示例7: UpdateVirtualDirectoryAsync

 /// <remarks/>
 public void UpdateVirtualDirectoryAsync(string siteId, WebVirtualDirectory directory, object userState) {
     if ((this.UpdateVirtualDirectoryOperationCompleted == null)) {
         this.UpdateVirtualDirectoryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateVirtualDirectoryOperationCompleted);
     }
     this.InvokeAsync("UpdateVirtualDirectory", new object[] {
                 siteId,
                 directory}, this.UpdateVirtualDirectoryOperationCompleted, userState);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:9,代码来源:WebServerProxy.cs

示例8: BeginUpdateVirtualDirectory

 /// <remarks/>
 public System.IAsyncResult BeginUpdateVirtualDirectory(string siteId, WebVirtualDirectory directory, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("UpdateVirtualDirectory", new object[] {
                 siteId,
                 directory}, callback, asyncState);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:6,代码来源:WebServerProxy.cs

示例9: UpdateVirtualDirectoryAsync

 /// <remarks/>
 public void UpdateVirtualDirectoryAsync(int siteItemId, WebVirtualDirectory vdir)
 {
     this.UpdateVirtualDirectoryAsync(siteItemId, vdir, null);
 }
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:5,代码来源:WebServersProxy.cs

示例10: UpdateVirtualDirectory

 public int UpdateVirtualDirectory(int siteItemId, WebVirtualDirectory vdir)
 {
     object[] results = this.Invoke("UpdateVirtualDirectory", new object[] {
                 siteItemId,
                 vdir});
     return ((int)(results[0]));
 }
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:7,代码来源:WebServersProxy.cs

示例11: IsWebManagementAccessEnabled

		private bool IsWebManagementAccessEnabled(WebVirtualDirectory iisObject)
		{
			using (var serverManager = webObjectsSvc.GetServerManager())
			{
				//
				string fqWebPath = String.Format("/{0}", iisObject.FullQualifiedPath);
				//
				Log.WriteInfo("FQ Web Path: " + fqWebPath);
				//
				Configuration config = serverManager.GetAdministrationConfiguration();
				ConfigurationSection authorizationSection = config.GetSection("system.webServer/management/authorization");
				ConfigurationElementCollection authorizationRulesCollection = authorizationSection.GetCollection("authorizationRules");

				ConfigurationElement scopeElement = FindElement(authorizationRulesCollection, "scope", "path", fqWebPath);

				if (scopeElement != null)
				{
					// At least one authorization rule exists
					if (scopeElement.GetCollection().Count > 0)
					{
						return true;
					}
				}
			}

			//
			return false;
		}
开发者ID:jordan49,项目名称:websitepanel,代码行数:28,代码来源:IIs70.cs

示例12: ReadWebManagementAccessDetails

		protected void ReadWebManagementAccessDetails(WebVirtualDirectory iisObject)
		{
			bool wmSvcAvailable = IsWebManagementServiceInstalled();
			//
			iisObject.SetValue<bool>(WebSite.WmSvcAvailable, wmSvcAvailable);
			//
			if (wmSvcAvailable)
			{
				//
				iisObject.SetValue<bool>(
					WebVirtualDirectory.WmSvcSiteEnabled, 
					IsWebManagementAccessEnabled(iisObject));

				using (var serverManager = webObjectsSvc.GetServerManager())
				{
					//
					string fqWebPath = @"/" + iisObject.FullQualifiedPath;
					//
					Configuration config = serverManager.GetAdministrationConfiguration();
					ConfigurationSection authorizationSection = config.GetSection("system.webServer/management/authorization");
					ConfigurationElementCollection authorizationRulesCollection = authorizationSection.GetCollection("authorizationRules");

					ConfigurationElement scopeElement = FindElement(authorizationRulesCollection, "scope", "path", fqWebPath);

					Log.WriteInfo("FQ WebPath: " + fqWebPath);

					if (scopeElement != null)
					{
						ConfigurationElementCollection scopeCollection = scopeElement.GetCollection();
						// Retrieve account name
						if (scopeCollection.Count > 0)
						{
							iisObject.SetValue<string>(
								WebSite.WmSvcAccountName,
								GetNonQualifiedAccountName((String)scopeCollection[0]["name"]));
							//
							iisObject.SetValue<string>(
								WebSite.WmSvcServiceUrl, ProviderSettings["WmSvc.ServiceUrl"]);
							//
							iisObject.SetValue<string>(
								WebSite.WmSvcServicePort, ProviderSettings["WmSvc.Port"]);
						}
					}
				}
			}
		}
开发者ID:jordan49,项目名称:websitepanel,代码行数:46,代码来源:IIs70.cs

示例13: match_webapp_pool

		//
		public WebAppPool match_webapp_pool(WebVirtualDirectory vdir)
		{
			// Detect isolation mode
			SiteAppPoolMode sisMode = is_shared_pool(vdir.ApplicationPool) ? 
				SiteAppPoolMode.Shared : SiteAppPoolMode.Dedicated;
			// Match proper app pool
			return Array.Find<WebAppPool>(SupportedAppPools.ToArray(),
				x => x.AspNetInstalled.Equals(vdir.AspNetInstalled) && isolation(x.Mode) == sisMode);
		}
开发者ID:jordan49,项目名称:websitepanel,代码行数:10,代码来源:IIs70.cs

示例14: CreateCFVirtualDirectories

        public override void CreateCFVirtualDirectories(string siteId)
        {
            WebVirtualDirectory scriptsDirectory = new WebVirtualDirectory();
            scriptsDirectory.Name = "CFIDE";
            scriptsDirectory.ContentPath = CFScriptsDirectoryPath;
            scriptsDirectory.EnableAnonymousAccess = true;
            scriptsDirectory.EnableWindowsAuthentication = true;
            scriptsDirectory.EnableBasicAuthentication = false;
            scriptsDirectory.DefaultDocs = null; // inherit from service
            scriptsDirectory.HttpRedirect = "";
            scriptsDirectory.HttpErrors = null;
            scriptsDirectory.MimeMaps = null;

            if (!VirtualDirectoryExists(siteId, scriptsDirectory.Name))
            {
                CreateVirtualDirectory(siteId, scriptsDirectory);
            }

            WebVirtualDirectory flashRemotingDir = new WebVirtualDirectory();
            flashRemotingDir.Name = "JRunScripts";
            flashRemotingDir.ContentPath = CFFlashRemotingDirPath;
            flashRemotingDir.EnableAnonymousAccess = true;
            flashRemotingDir.EnableWindowsAuthentication = true;
            flashRemotingDir.EnableBasicAuthentication = false;
            flashRemotingDir.DefaultDocs = null; // inherit from service
            flashRemotingDir.HttpRedirect = "";
            flashRemotingDir.HttpErrors = null;
            flashRemotingDir.MimeMaps = null;

            if (!VirtualDirectoryExists(siteId, flashRemotingDir.Name))
            {
                CreateVirtualDirectory(siteId, flashRemotingDir);
            }
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:34,代码来源:IIs70.cs

示例15: DeleteVirtualDirectory

		/// <summary>
		/// Deletes virtual iisDirObject within specified site.
		/// </summary>
		/// <param name="siteId">Site id.</param>
		/// <param name="directoryName">Directory name to delete.</param>
		public override void DeleteVirtualDirectory(string siteId, string directoryName)
		{
			var virtualDir = new WebVirtualDirectory
			{
				ParentSiteName = siteId,
				Name = directoryName
			};
            //
            webObjectsSvc.DeleteVirtualDirectory(virtualDir);
            anonymAuthSvc.RemoveAuthenticationSettings(virtualDir.FullQualifiedPath);
		}
开发者ID:jordan49,项目名称:websitepanel,代码行数:16,代码来源:IIs70.cs


注:本文中的WebsitePanel.Providers.Web.WebVirtualDirectory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。