相关疑难解决方法(0)

使用.NET检查Internet连接的最佳方法是什么?

在.NET中检查Internet连接的最快,最有效的方法是什么?

.net c# internet-connection

224
推荐指数
11
解决办法
21万
查看次数

如何检查网络连接?

确定是否有可用的网络连接的最佳方法是什么?

c# networking

109
推荐指数
3
解决办法
10万
查看次数

为什么GetIsNetworkAvailable()总是返回true?

我有这个方法:

public static void testConnection()
    {
        if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
        {
            System.Windows.MessageBox.Show("This computer is connected to the internet");
        }
        else
        {
            System.Windows.MessageBox.Show("This computer is not connected to the internet");
        }
    }
Run Code Online (Sandbox Code Playgroud)

我想它会告诉我连接是否可用但它总是返回true(并打印第一条消息),即使我确定没有连接.我做错了什么?

PS:我还在学习C#.

c# windows networking

14
推荐指数
2
解决办法
9935
查看次数

标签 统计

c# ×3

networking ×2

.net ×1

internet-connection ×1

windows ×1