本文整理汇总了C#中Host.Create方法的典型用法代码示例。如果您正苦于以下问题:C# Host.Create方法的具体用法?C# Host.Create怎么用?C# Host.Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host.Create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Utility.NoSpaceNotEmpty(txtHostName.Text))
{
if (Utility.NoSpaceNotEmpty(txtHostMac.Text))
{
if (Utility.NoSpaceNotEmpty(ddlHostKernel.Text))
{
if (Utility.NoSpaceNotEmpty(ddlHostBootImage.Text))
{
Host host = new Host();
host.Name = txtHostName.Text;
host.Mac = Utility.FixMac(txtHostMac.Text);
host.Image = ddlHostImage.Text;
host.Group = ddlHostGroup.Text;
host.Description = txtHostDesc.Text;
host.Kernel = ddlHostKernel.Text;
host.BootImage = ddlHostBootImage.Text;
host.Args = txtHostArguments.Text;
foreach (ListItem item in lbScripts.Items)
if (item.Selected == true)
host.Scripts += item.Value + ",";
host.Create(host);
if (Utility.Message.Contains("Successfully") && !createAnother.Checked)
Response.Redirect("~/views/hosts/view.aspx?page=edit&hostid=" + host.GetHostID(host.Mac));
else
Master.Msgbox(Utility.Message);
}
else
Master.Msgbox("Boot Image Cannot Be Empty");
}
else
Master.Msgbox("Kernel Cannot Be Empty");
}
else
Master.Msgbox("MAC Address Cannot Be Empty Or Contain Spaces");
}
else
Master.Msgbox("Name Cannot Be Empty Or Contain Spaces");
}
示例2: AddHost
public void AddHost(Host host)
{
host.Create(host);
HttpContext.Current.Response.Write(Utility.Message);
}