本文整理汇总了C#中Util.GetEndUserCredentials方法的典型用法代码示例。如果您正苦于以下问题:C# Util.GetEndUserCredentials方法的具体用法?C# Util.GetEndUserCredentials怎么用?C# Util.GetEndUserCredentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util.GetEndUserCredentials方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowCredentials
protected void ShowCredentials()
{
Util util = new Util();
ArrayList credentials = util.GetEndUserCredentials((Hashtable)HttpRuntime.Cache[Session.SessionID]);
if (credentials == null || credentials.Count == 0)
return;
DataTable CredentialsTable = new DataTable();
CredentialsTable.Columns.Add("Username");
CredentialsTable.Columns.Add("Password");
//CredentialsTable.Columns.Add(" ");
foreach (string[] service in credentials)
{
DataRow row = CredentialsTable.NewRow();
row.ItemArray = service;
CredentialsTable.Rows.Add(row);
}
Credentials.DataSource = CredentialsTable;
Credentials.DataBind();
/*int index = 0;
Init init = new Init();
foreach (GridDataItem row in Credentials.Items)
{
string[] service = (string[])credentials[index];
if (service[1] == null || service[1].Length == 0)
{
RadComboBox box = new RadComboBox();
box.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(box_SelectedIndexChanged);
box.AutoPostBack = true;
box.ID = "ServiceApp." + index.ToString();
box.Width = Unit.Pixel(200);
init.InitAppsListNoDefault((Hashtable)HttpRuntime.Cache[Session.SessionID], box);
row.Cells[3].Controls.Add(box);
}
else
{
ImageButton delete_button = new ImageButton();
delete_button.ImageUrl = "~/images/delete_small.gif";
delete_button.ID = "remove." + index.ToString();
delete_button.ToolTip = "Remove this service from this app";
delete_button.Click += new ImageClickEventHandler(delete_button_Click);
delete_button.Attributes.Add("onclick", "return confirm('Are you sure you want to remove this app from this service?');");
row.Cells[4].Controls.Add(delete_button);
}
index++;
}*/
}
示例2: page_refresh
//.........这里部分代码省略.........
/*if (util.IsAppStoreSubmissionPaid(State, State["SelectedApp"].ToString()))
{*/
/*SubmissionNotes.Visible = true;
SubmissionNotesLabel.Visible = true;*/
//PurchaseButton.Visible = false;
/*}
else
{
SubmitForProvisioning.Visible = false;
SubmissionNotes.Visible = false;
SubmissionNotesLabel.Visible = false;
//PurchaseButton.Visible = true;
//ProvisioningMessage.Text = "You can fill this form any time, but to submit your app for production, you need to first purchase one of the ViziApps services to submit the app to an app store.";
//PurchaseButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript("http://stores.homestead.com/MobiFlexStore/StoreFront.bok", 700, 900, false, false, false, true));
}*/
DB db = new DB();
StringBuilder b_sql = new StringBuilder("SELECT * FROM applications ");
b_sql.Append("WHERE application_name='" + State["SelectedApp"].ToString() + "'");
b_sql.Append(" AND customer_id='" + State["CustomerID"].ToString() + "'");
DataRow[] rows = db.ViziAppsExecuteSql(State, b_sql.ToString());
if (rows.Length > 0)
{
DataRow row = rows[0];
if (row["production_app_name"] != null)
ProductionAppName.Text = row["production_app_name"].ToString();
if (row["production_app_xml"] != DBNull.Value)
ProductionDesignExists.Visible = true;
else
ProductionDesignExists.Visible = false;
bool use_1_user_credential = false;
if (row["use_1_user_credential"] != DBNull.Value)
{
string use_1_cred = row["use_1_user_credential"].ToString();
use_1_user_credential = (use_1_cred.ToLower() == "true") ? true : false;
}
bool has_unlimited_users = false;
if (row["has_unlimited_users"] != DBNull.Value)
{
string has_unlimited = row["has_unlimited_users"].ToString();
has_unlimited_users = (has_unlimited.ToLower() == "true") ? true : false;
}
if (use_1_user_credential)
{
//NumberOfUsers.Style.Value = "";
//NumberOfUsersLabel.Style.Value = "";
//NumberOfUsers.SelectedIndex = 1;
ArrayList credential = util.GetEndUserCredentials(State);
if (credential != null && credential.Count > 0)
{
string[] output = (string[])credential[0];
SingleUsername.Text = output[0];
SinglePassword.Text = output[1];
}
LimitedUsersPanel.Style.Value = "";
}
else if (has_unlimited_users)
{
//NumberOfUsers.Style.Value = "display:none";
//NumberOfUsersLabel.Style.Value = "display:none";
LimitedUsersPanel.Style.Value = "display:none";
}
else
{
long max_users = util.GetMaxUsers(State);
if (max_users > 1000)
{
//NumberOfUsers.Style.Value = "display:none";
//NumberOfUsersLabel.Style.Value = "display:none";
LimitedUsersPanel.Style.Value = "display:none";
util.SetUnlimitedUsers(State);
}
}
}
b_sql = new StringBuilder("SELECT * FROM branding_images ");
b_sql.Append("WHERE application_id='" + State["ApplicationID"].ToString() + "'");
rows = db.ViziAppsExecuteSql(State, b_sql.ToString());
foreach (DataRow image_row in rows)
{
if (image_row["type"].ToString() == "icon" && image_row["width"].ToString() == "512")
{
LargeIconButton.Visible = true;
DeleteIcon.Visible = true;
}
if (image_row["type"].ToString() == "splash")
{
ScreenSplashButton.Visible = true;
DeleteSplashImage.Visible = true;
}
}
db.CloseViziAppsDatabase(State);
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (State == null || State.Count <= 2) { Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "timeOut('../../Default.aspx');", true); return; }
try
{
ClearMessages();
State["ApplicationID"] = util.GetAppID(State);
App.Text = "Test Native App Name: " + State["SelectedApp"].ToString();
if (util.IsAppStoreSubmissionPaid(State, State["SelectedApp"].ToString()))
{
SubmitForProvisioning.Visible = true;
SubmissionNotes.Visible = true;
SubmissionNotesLabel.Visible = true;
PurchaseButton.Visible = false;
}
else
{
SubmitForProvisioning.Visible = false;
SubmissionNotes.Visible = false;
SubmissionNotesLabel.Visible = false;
PurchaseButton.Visible = true;
ProvisioningMessage.Text = "You can fill this form any time, but to submit your app for production, you need to first purchase one of the ViziApps services to submit the app to an app store.";
PurchaseButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
"http://stores.homestead.com/MobiFlexStore/StoreFront.bok", 700, 900, false, false, false, true));
}
if (!IsPostBack)
{
DB db = new DB();
StringBuilder b_sql = new StringBuilder("SELECT * FROM applications ");
b_sql.Append("WHERE application_name='" + State["SelectedApp"].ToString() + "'");
b_sql.Append(" AND customer_id='" + State["CustomerID"].ToString() + "'");
DataRow[] rows = db.ViziAppsExecuteSql(State, b_sql.ToString());
DataRow row = rows[0];
if (row["production_app_name"] != null)
ProductionAppName.Text = row["production_app_name"].ToString();
if (row["production_app_xml"] != DBNull.Value)
ProductionDesignExists.Visible = true;
else
ProductionDesignExists.Visible = false;
bool use_1_user_credential = false;
if (row["use_1_user_credential"] != DBNull.Value)
{
string use_1_cred = row["use_1_user_credential"].ToString();
use_1_user_credential = (use_1_cred.ToLower() == "true") ? true : false;
}
bool has_unlimited_users = false;
if (row["has_unlimited_users"] != DBNull.Value)
{
string has_unlimited = row["has_unlimited_users"].ToString();
has_unlimited_users = (has_unlimited.ToLower() == "true") ? true : false;
}
if (use_1_user_credential)
{
NumberOfUsers.Style.Value = "";
NumberOfUsersLabel.Style.Value = "";
NumberOfUsers.SelectedIndex = 1;
ArrayList credential = util.GetEndUserCredentials(State);
if (credential != null && credential.Count > 0)
{
string[] output = (string[])credential[0];
SingleUsername.Text = output[0];
SinglePassword.Text = output[1];
}
LimitedUsersPanel.Style.Value = "";
}
else if (has_unlimited_users)
{
NumberOfUsers.Style.Value = "display:none";
NumberOfUsersLabel.Style.Value = "display:none";
LimitedUsersPanel.Style.Value = "display:none";
}
else
{
long max_users = util.GetMaxUsers(State);
if (max_users > 1000)
{
NumberOfUsers.Style.Value = "display:none";
NumberOfUsersLabel.Style.Value = "display:none";
LimitedUsersPanel.Style.Value = "display:none";
util.SetUnlimitedUsers(State);
}
else
{
UploadPublishedUserCredentials.Style.Value = "";
ViewPublishedUserCredentials.Style.Value = "";
UploadPublishedUserCredentials.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
"../../Dialogs/Publish/UploadUserCredentials.aspx", 350, 800, false, false, false, true));
ViewPublishedUserCredentials.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
//.........这里部分代码省略.........