本文整理汇总了C#中Network.UpdateStatus方法的典型用法代码示例。如果您正苦于以下问题:C# Network.UpdateStatus方法的具体用法?C# Network.UpdateStatus怎么用?C# Network.UpdateStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network.UpdateStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: connecter
public static bool connecter()
{
_network = new Network(null);
foreach (CommNetwork coms in primes)
{
try
{
coms.Comms.Open();
_network.UpdateStatus(coms.Names, "connected");
connect=true;
}
catch (Exception r)
{
Console.WriteLine("comm has failed to disconnect");
connect = false;
}
}
return connect;
}
示例2: SendUpdate
public static bool SendUpdate(DBObject parent, string id, string message, string number, string network, string cb)
{
_network = new Network(null);
comm = new GsmCommMain(cb, 9600, 150);
try
{
SmsSubmitPdu pdu;
byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;
pdu = new SmsSubmitPdu(message, Convert.ToString(number), dcs);
int times = 1;
for (int i = 0; i < times; i++)
{
if (comm.IsConnected())
{
Console.WriteLine("comm is already open");
Console.WriteLine("modem connected:" + network + "to:" + comm);
_network.UpdateStatus(network, "connected");
}
else
{
comm.Open();
_network.UpdateStatus(network, "connected");
}
comm.SendMessage(pdu);
_message = new Message(parent);
_message.Update(id, "T");
sent = true;
}
sent = true;
}
catch (Exception r)
{
sent = false;
_network.UpdateStatus(network, "disconnected");
Console.WriteLine("comm is already open");
}
return sent;
}