本文整理汇总了C#中DataClasses1DataContext.Insert_restartVPN_last_ip方法的典型用法代码示例。如果您正苦于以下问题:C# DataClasses1DataContext.Insert_restartVPN_last_ip方法的具体用法?C# DataClasses1DataContext.Insert_restartVPN_last_ip怎么用?C# DataClasses1DataContext.Insert_restartVPN_last_ip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataClasses1DataContext
的用法示例。
在下文中一共展示了DataClasses1DataContext.Insert_restartVPN_last_ip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: checkIp
static void checkIp()
{
DataClasses1DataContext database = new DataClasses1DataContext();
string ip = "176.9.103.131";
try
{
ip = VerifyIp();
int nrsecwait = 0;
while (ip.Contains("176.9.103.131"))//("89.33.106.3"))
{
Thread.Sleep(1000);
nrsecwait++;
if (nrsecwait % 10 == 0)
{
System.Console.WriteLine("VPN neconectat - " + DateTime.Now.ToString());
ip = VerifyIp();
//insereaza in tabel ip=ul
database.Insert_restartVPN_last_ip(ip);
}
//System.Console.WriteLine(nrsecwait);
if (nrsecwait > 30 && nrsecwait % 60 == 0)
{
#if DEBUG
System.Console.WriteLine("Se Face Restart La VPN - " + DateTime.Now.ToString());
// Process.Start("C:\\Users\\Adrian.Ghibaor\\Documents\\Visual Studio 2013\\Projects\\GetAgentie\\GetAgentie\\bin\\Release\\GetAgentie.exe");
#else
DateTime time = DateTime.Now;
System.Console.WriteLine("Se Face Restart La VPN - " + DateTime.Now.ToString());
Process.Start("script_vpn.exe");
Thread.Sleep(25000); // se asteapta 25 secunde pt ca si script_vpn are un sleep de 10 secunde pana face connnect si poate dura 10 secunde pana se conecteaza
System.Console.WriteLine("Acum ar trebui sa fie connectat - " + DateTime.Now.ToString());
#endif
ip = VerifyIp();
}
}
System.Console.WriteLine("VPN ok");
//inseereaza in tabel ip-ul
database.Insert_restartVPN_last_ip(ip);
}
catch (Exception e)
{
System.Console.WriteLine("Nu s-a putut verifica ip-ul, reincerc in 20 secunde - " + DateTime.Now.ToString());
//inseereaza in tabel ip-ul
database.Insert_restartVPN_last_ip(ip);
}
}