如何用C#编写这些代码?
我要编写代码得知我电脑是否已与internat网连接? 问题点数:20、回复次数:2Top
1 楼wsh236(与龙同在)回复于 2005-08-21 11:42:17 得分 0
listBox1.Items.Add("ComputerName : " + SystemInformation.ComputerName );
listBox1.Items.Add("Network : " + SystemInformation.Network );
listBox1.Items.Add("UserDomainName : " + SystemInformation.UserDomainName );
listBox1.Items.Add("UserName : " + SystemInformation.UserName );
listBox1.Items.Add("BootMode : " + SystemInformation.BootMode );
listBox1.Items.Add("MenuFont : " + SystemInformation.MenuFont );
listBox1.Items.Add("MonitorCount : " + SystemInformation.MonitorCount );
listBox1.Items.Add("MonitorsSameDisplayFormat : " + SystemInformation.MonitorsSameDisplayFormat.ToString() );
listBox1.Items.Add("ArrangeDirection: " + SystemInformation.ArrangeDirection);
listBox1.Items.Add("MousePresent : " + SystemInformation.MousePresent );
listBox1.Items.Add("MouseButtonsSwapped : " + SystemInformation.MouseButtonsSwapped );
listBox1.Items.Add("UserInteractive : " + SystemInformation.UserInteractive );
listBox1.Items.Add("VirtualScreen: " + SystemInformation.VirtualScreen );Top
2 楼helloworld84(思考中....)回复于 2005-08-21 11:45:59 得分 20
[DllImport("wininet.dll")]
public extern static bool InternetGetConnectedState( out int connectionDescription, int reservedValue ) ;
public InternetGetConnectedState1() { }
public bool IsConnected()
{
int I=0;
bool state = InternetGetConnectedState(out I,0);
return state;
}Top




