日期:2014-05-19  浏览次数:21164 次

如何判断我当前的网络是否和五联网联通呢?
如题

------解决方案--------------------
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Runtime;
using System.Runtime.InteropServices;

/// <summary>
/// internetCS 的摘要说明

/// </summary>


public class InternetCS
{

//Creating the extern function...
[DllImport( "wininet.dll ")]
private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);

//Creating a function that uses the API function...
public static bool IsConnectedToInternet()
{

int Desc;
return InternetGetConnectedState(out Desc, 0);

}

}