本文整理汇总了C#中Service.NotifyServer方法的典型用法代码示例。如果您正苦于以下问题:C# Service.NotifyServer方法的具体用法?C# Service.NotifyServer怎么用?C# Service.NotifyServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service.NotifyServer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: machineListGridView_RowCommand
protected void machineListGridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if(e.CommandName=="MachineName")
{
GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
Label clientAddressLabel = (Label)machineListGridView.Rows[row.RowIndex].FindControl("clientAddressLabel");
//LinkButton lnkButton = (LinkButton)e.CommandSource;
using (DuplexApp_dbEntities entities = new DuplexApp_dbEntities())
{
var data = entities.MachineDetails.Where(m => m.ClientAddress == clientAddressLabel.Text.Trim()).FirstOrDefault();
if (data != null)
{
data.AvailableFunction = null;
entities.SaveChanges();
}
}
Service vs = new Service();
vs.NotifyServer(clientAddressLabel.Text,"FindFunction",null);
Response.Redirect("FunctionList.aspx?ClientAddress="+clientAddressLabel.Text.Trim(), false);
}
}
catch (Exception ex)
{
logger.Info(ex.Message.ToString());
}
}
示例2: functionNameButton_Click
protected void functionNameButton_Click(object sender, EventArgs e)
{
try
{
Button functonNamebutton = (Button)sender;
Service vs = new Service();
vs.NotifyServer(GetQueryString("ClientAddress").Trim(), "ExecuteFunction", functonNamebutton.Text);
if(vs.errorMsg!=string.Empty)
{
Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('" + vs.errorMsg + "');", true);
}
else
{
Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('"+functonNamebutton.Text.Trim()+" command executed on client machine.');", true);
}
}catch (Exception ex)
{
logger.Info(ex.Message.ToString());
}
}