本文整理汇总了C#中Host.Read方法的典型用法代码示例。如果您正苦于以下问题:C# Host.Read方法的具体用法?C# Host.Read怎么用?C# Host.Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host.Read方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
public void Delete(List<int> listDelete)
{
try
{
using (NpgsqlConnection conn = new NpgsqlConnection(Utility.DBString))
{
conn.Open();
for (int i = 0; i < listDelete.Count; i++)
{
Host host = new Host();
host.ID = listDelete[i].ToString();
host = host.Read(host);
NpgsqlCommand cmd = new NpgsqlCommand("hosts_delete", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new NpgsqlParameter("@hostID", listDelete[i]));
cmd.ExecuteNonQuery();
History history = new History();
history.Event = "Delete";
history.Type = "Host";
history.Notes = host.Name;
history.TypeID = host.ID;
history.CreateEvent(history);
}
Utility.Message = "Successfully Deleted Host(s)";
}
}
catch (Exception ex)
{
Utility.Message = "Could Not Delete Host. Check The Exception Log For More Info";
Logger.Log(ex.ToString());
}
}
示例2: getHostName
public void getHostName(string mac)
{
Host host = new Host();
host.ID = host.GetHostID(mac);
if (host.ID == "error")
{
HttpContext.Current.Response.Write("");
return;
}
host.Read(host);
HttpContext.Current.Response.Write(host.Name);
}
示例3: btnSetBootMenu_Click
protected void btnSetBootMenu_Click(object sender, EventArgs e)
{
foreach (string hostID in group.GetMemberIDs(group.Name))
{
Host host = new Host();
host.ID = hostID;
host = host.Read(host);
host.SetCustomBootMenu(host, txtCustomBootMenu.Text);
}
History historyg = new History();
historyg.Event = "Set Boot Menu";
historyg.Type = "Group";
historyg.TypeID = group.ID;
historyg.CreateEvent(historyg);
Master.Msgbox(Utility.Message);
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
host = new Host();
requestedPage = Request.QueryString["page"] as string;
host.ID = Request["hostid"] as string;
host.Read(host);
if (!IsPostBack)
{
Master.Msgbox(Utility.Message);
switch (requestedPage)
{
case "edit":
lblSubNav.Text = "| edit";
edit.Visible = true;
edit_page();
break;
case "history":
lblSubNav.Text = "| history";
history.Visible = true;
history_page();
break;
case "activebootmenu":
lblSubNav.Text = "| boot menu";
activebootmenu.Visible = true;
activebootmenu_page();
break;
case "custombootmenu":
lblSubNav.Text = "| boot menu";
custombootmenu.Visible = true;
custombootmenu_page();
break;
case "log":
lblSubNav.Text = "| log";
logs.Visible = true;
logs_page();
break;
default:
break;
}
}
}