C
C#2y ago
froxerbbq

❔ When Vpn connectivity is off don't crash the app.

I have built this logic it does make a popup appear with a message about vpn not being connected if VPN looses connectivity(For example if i turn it off), best case scenario this didn't instantly happend and re attempted 3 times with a delay in between.
var interfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (var vpn in interfaces)
{

if (vpn.Description.StartsWith("qwerty"))
{
m_cxz.Merge(m_asd.GetData(Id, (showSomething) ? (int?)null : 1));
break;
}

MessageBox.Show("vpn is not connected");
}
var interfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (var vpn in interfaces)
{

if (vpn.Description.StartsWith("qwerty"))
{
m_cxz.Merge(m_asd.GetData(Id, (showSomething) ? (int?)null : 1));
break;
}

MessageBox.Show("vpn is not connected");
}
6 Replies
Anton
Anton2y ago
$code
MODiX
MODiX2y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
Anton
Anton2y ago
so?
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
froxerbbq
froxerbbq2y ago
sorry, I am available now (02:15 in morning but awake for bit more) had some family issues. I have changed the OP so that it has C# capsulated in code markup.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.