• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Web.WebSite类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: BindSecuredFolders

		public void BindSecuredFolders(WebSite site)
        {
            // save initial state
            IsSecuredFoldersInstalled = site.SecuredFoldersInstalled;
			// Render a warning message about the automatic site's settings change
			if (!IsSecuredFoldersInstalled && site.IIs7)
			{
				// Ensure the message is displayed only when neccessary
				if (site.EnableWindowsAuthentication || !site.AspNetInstalled.EndsWith("I"))
				{
					string warningStr = GetLocalizedString("EnableFoldersIIs7Warning.Text");
					// Render a warning only if specified
					if (!String.IsNullOrEmpty(warningStr))
						btnToggleSecuredFolders.OnClientClick = String.Format("return confirm('{0}')", warningStr);
				}
			}
            // toggle
            ToggleControls();
        }
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:19,代码来源:WebSitesSecuredFoldersControl.ascx.cs


示例2: SetWebSiteApplicationPool

		/// <summary>
		/// Creates if needed dedicated iisAppObject pools and assigns to specified site iisAppObject pool according to 
		/// selected ASP.NET version.
		/// </summary>
		/// <param name="site">WEb site to operate on.</param>
		/// <param name="createAppPools">A value which shows whether iisAppObject pools has to be created.</param>
        private void SetWebSiteApplicationPool(WebSite site, bool createAppPools)
        {
			var aphl = new WebAppPoolHelper(ProviderSettings);
			// Site isolation mode
			var sisMode = site.DedicatedApplicationPool ? SiteAppPoolMode.Dedicated : SiteAppPoolMode.Shared;
			// Create dedicated iisAppObject pool name for the site with installed ASP.NET version
			if (createAppPools && site.DedicatedApplicationPool)
			{
				// Find dedicated app pools
				var dedicatedPools = Array.FindAll<WebAppPool>(aphl.SupportedAppPools.ToArray(),
					x => aphl.isolation(x.Mode) == SiteAppPoolMode.Dedicated);
				// Generate dedicated iisAppObject pools names and create them.
				foreach (var item in dedicatedPools)
				{
					// Retrieve .NET Framework version
					var dotNetVersion = aphl.dotNetVersion(item.Mode);
					//
					var enable32BitAppOnWin64 = Enable32BitAppOnWin64;
					// Force "enable32BitAppOnWin64" set to true for .NET v1.1
					if (dotNetVersion == SiteAppPoolMode.dotNetFramework1)
						enable32BitAppOnWin64 = true;
					//
					var poolName = WSHelper.InferAppPoolName(item.Name, site.Name, item.Mode);
					// Ensure we are not going to add an existing app pool
					if (webObjectsSvc.IsApplicationPoolExist(poolName))
						continue;
					//
					using (var srvman = webObjectsSvc.GetServerManager())
					{
						// Create iisAppObject pool
						var pool = srvman.ApplicationPools.Add(poolName);
						pool.ManagedRuntimeVersion = aphl.aspnet_runtime(item.Mode);
						pool.ManagedPipelineMode = aphl.runtime_pipeline(item.Mode);
						pool.Enable32BitAppOnWin64 = enable32BitAppOnWin64;
						pool.AutoStart = true;
						// Identity
						pool.ProcessModel.IdentityType = ProcessModelIdentityType.SpecificUser;
						pool.ProcessModel.UserName = GetQualifiedAccountName(site.AnonymousUsername);
						pool.ProcessModel.Password = site.AnonymousUserPassword;
						// Commit changes
						srvman.CommitChanges();
					}
				}
			}
			// Find
			var siteAppPool = Array.Find<WebAppPool>(aphl.SupportedAppPools.ToArray(),
				x => x.AspNetInstalled.Equals(site.AspNetInstalled) && aphl.isolation(x.Mode) == sisMode);
			// Assign iisAppObject pool according to ASP.NET version installed and isolation mode specified.
			site.ApplicationPool = WSHelper.InferAppPoolName(siteAppPool.Name, site.Name, siteAppPool.Mode);
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:56,代码来源:IIs70.cs


示例3: UpdateSiteAsync

 /// <remarks/>
 public void UpdateSiteAsync(WebSite site) {
     this.UpdateSiteAsync(site, null);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:4,代码来源:WebServerProxy.cs


示例4: UpdateSite

 public void UpdateSite(WebSite site) {
     this.Invoke("UpdateSite", new object[] {
                 site});
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:4,代码来源:WebServerProxy.cs


示例5: CreateSite

 public string CreateSite(WebSite site) {
     object[] results = this.Invoke("CreateSite", new object[] {
                 site});
     return ((string)(results[0]));
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:5,代码来源:WebServerProxy.cs


示例6: CheckCertificateAsync

 /// <remarks/>
 public void CheckCertificateAsync(WebSite webSite)
 {
     this.CheckCertificateAsync(webSite, null);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:5,代码来源:WebServerProxy.cs


示例7: CheckCertificate

 public bool CheckCertificate(WebSite webSite)
 {
     object[] results = this.Invoke("CheckCertificate", new object[] {
                 webSite});
     return ((bool)(results[0]));
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:6,代码来源:WebServerProxy.cs


示例8: ImportCertificate

 public SSLCertificate ImportCertificate(WebSite website)
 {
     object[] results = this.Invoke("ImportCertificate", new object[] {
                 website});
     return ((SSLCertificate)(results[0]));
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:6,代码来源:WebServerProxy.cs


示例9: installCertificate

 public SSLCertificate installCertificate(SSLCertificate certificate, WebSite website)
 {
     object[] results = this.Invoke("installCertificate", new object[] {
                 certificate,
                 website});
     return ((SSLCertificate)(results[0]));
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:7,代码来源:WebServerProxy.cs


示例10: getCertificateAsync

 /// <remarks/>
 public void getCertificateAsync(WebSite site)
 {
     this.getCertificateAsync(site, null);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:5,代码来源:WebServerProxy.cs


示例11: getCertificate

 public SSLCertificate getCertificate(WebSite site)
 {
     object[] results = this.Invoke("getCertificate", new object[] {
                 site});
     return ((SSLCertificate)(results[0]));
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:6,代码来源:WebServerProxy.cs


示例12: UpdateWebSite

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


示例13: UpdateWebSite

        public static int UpdateWebSite(WebSite site)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // load web site item
            WebSite siteItem = (WebSite)PackageController.GetPackageItem(site.Id);
            if (siteItem == null)
                return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;

            // place log record
            TaskManager.StartTask("WEB_SITE", "UPDATE", siteItem.Name);
            TaskManager.ItemId = site.Id;

            try
            {
                // update home folder
                string origPath = site.ContentPath;
                site.ContentPath = FilesController.GetFullPackagePath(site.PackageId, site.ContentPath);

                // build data folder path
                site.DataPath = siteItem.DataPath;

                // update site on the service
                WebServer web = new WebServer();
                ServiceProviderProxy.Init(web, siteItem.ServiceId);
                web.UpdateSite(site);
				// Restore settings back
				#region Web Deploy Settings
				site.WebDeployPublishingAccount = siteItem.WebDeployPublishingAccount;
				site.WebDeployPublishingPassword = siteItem.WebDeployPublishingPassword;
				site.WebDeploySitePublishingEnabled = siteItem.WebDeploySitePublishingEnabled;
				site.WebDeploySitePublishingProfile = siteItem.WebDeploySitePublishingProfile;
				#endregion

                // update service item
                PackageController.UpdatePackageItem(site);

                // set origpath
                site.ContentPath = origPath;

                return 0;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:53,代码来源:WebServerController.cs


示例14: AddWebSite

        public static int AddWebSite(int packageId, int domainId, int packageAddressId,
            bool addInstantAlias)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // check package
            int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive);
            if (packageCheck < 0) return packageCheck;

            // check quota
            QuotaValueInfo sitesQuota = PackageController.GetPackageQuota(packageId, Quotas.WEB_SITES);
            if (sitesQuota.QuotaExhausted)
                return BusinessErrorCodes.ERROR_WEB_SITES_QUOTA_LIMIT;

            // load domain name
            DomainInfo domain = ServerController.GetDomain(domainId);
            string domainName = domain.DomainName;

            // check if the web site already exists
            if (PackageController.GetPackageItemByName(packageId, domainName, typeof(WebSite)) != null)
                return BusinessErrorCodes.ERROR_WEB_SITE_ALREADY_EXISTS;

            // place log record
            TaskManager.StartTask("WEB_SITE", "ADD", domainName);

            try
            {

                // get service
                int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Web);
                if (serviceId == 0)
                    return BusinessErrorCodes.ERROR_WEB_SITE_SERVICE_UNAVAILABLE;

				#region Fix for bug #587
				// Initialize IIS provider webservice proxy
				WebServer web = new WebServer();
				ServiceProviderProxy.Init(web, serviceId);

				// Ensure the web site is being created doesn't exist on the server
				if (web.SiteExists(domainName))
				{
					//
					PackageInfo packageInfo = PackageController.GetPackage(packageId);
					//
					ServerInfo serverInfo = ServerController.GetServerById(packageInfo.ServerId);
					// Give as much clues for the issue to an administrator as possible
					TaskManager.WriteError("Web site '{0}' could not be created because site with the name requested already " +
						"exists on '{1}' server.", domainName, serverInfo.ServerName);
					// Return generic operation failed error
					return BusinessErrorCodes.FAILED_EXECUTE_SERVICE_OPERATION;
				} 
				#endregion

                // load web settings
                StringDictionary webSettings = ServerController.GetServiceSettings(serviceId);
                int addressId = Utils.ParseInt(webSettings["SharedIP"], 0);

                bool dedicatedIp = false;
                if (packageAddressId != 0)
                {
                    // dedicated IP
                    PackageIPAddress packageIp = ServerController.GetPackageIPAddress(packageAddressId);
                    if (packageIp != null)
                    {
                        addressId = packageIp.AddressID;
                        dedicatedIp = true;
                    }
                }

                // load assigned IP address
                string ipAddr = "*";
                IPAddressInfo ip = ServerController.GetIPAddress(addressId);
                if (ip != null)
                    ipAddr = !String.IsNullOrEmpty(ip.InternalIP) ? ip.InternalIP : ip.ExternalIP;

                // load domain instant alias
                string instantAlias = ServerController.GetDomainAlias(packageId, domainName);
                DomainInfo instantDomain = ServerController.GetDomain(instantAlias);
                if (instantDomain == null || instantDomain.WebSiteId > 0)
                    instantAlias = "";

                // load web DNS records
                List<GlobalDnsRecord> dnsRecords = ServerController.GetDnsRecordsByService(serviceId);

                // prepare site bindings
                List<ServerBinding> bindings = new List<ServerBinding>();

                if (!dedicatedIp)
                {
                    // SHARED IP
                    // fill main domain bindings
                    FillWebServerBindings(bindings, dnsRecords, ipAddr, domain.DomainName);

                    // fill alias bindings if required
                    if (addInstantAlias && !String.IsNullOrEmpty(instantAlias))
                    {
                        // fill bindings from DNS "A" records
                        FillWebServerBindings(bindings, dnsRecords, ipAddr, instantAlias);
//.........这里部分代码省略.........
开发者ID:jordan49,项目名称:websitepanel,代码行数:101,代码来源:WebServerController.cs


示例15: DeleteCertificateAsync

 /// <remarks/>
 public void DeleteCertificateAsync(SSLCertificate certificate, WebSite website)
 {
     this.DeleteCertificateAsync(certificate, website, null);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:5,代码来源:WebServerProxy.cs


示例16: installCertificateAsync

 /// <remarks/>
 public void installCertificateAsync(SSLCertificate certificate, WebSite website)
 {
     this.installCertificateAsync(certificate, website, null);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:5,代码来源:WebServerProxy.cs


示例17: installPFX

 public SSLCertificate installPFX([System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] byte[] certificate, string password, WebSite website)
 {
     object[] results = this.Invoke("installPFX", new object[] {
                 certificate,
                 password,
                 website});
     return ((SSLCertificate)(results[0]));
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:8,代码来源:WebServerProxy.cs


示例18: ImportCertificateAsync

 /// <remarks/>
 public void ImportCertificateAsync(WebSite website)
 {
     this.ImportCertificateAsync(website, null);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:5,代码来源:WebServerProxy.cs


示例19: BegininstallPFX

 /// <remarks/>
 public System.IAsyncResult BegininstallPFX(byte[] certificate, string password, WebSite website, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("installPFX", new object[] {
                 certificate,
                 password,
                 website}, callback, asyncState);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:8,代码来源:WebServerProxy.cs


示例20: BeginCheckCertificate

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Web.WebVirtualDirectory类代码示例发布时间:2022-05-26
下一篇:
C# Web.WebServer类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap