本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
示例9: UpdateVirtualDirectoryAsync
/// <remarks/>
public void UpdateVirtualDirectoryAsync(int siteItemId, WebVirtualDirectory vdir)
{
this.UpdateVirtualDirectoryAsync(siteItemId, vdir, null);
}
示例10: UpdateVirtualDirectory
public int UpdateVirtualDirectory(int siteItemId, WebVirtualDirectory vdir)
{
object[] results = this.Invoke("UpdateVirtualDirectory", new object[] {
siteItemId,
vdir});
return ((int)(results[0]));
}
示例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;
}
示例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"]);
}
}
}
}
}
示例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);
}
示例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);
}
}
示例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);
}