| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
- winmodev
- 거제도
- 김춘배
- MIX10
- 데브피아
- 소년포비
- 윈도우 모바일
- 신동혁
- UX베이커리
- 윈도우폰
- 윈도우폰7
- 윈도우모바일
- 서진호
- 주신영
- 옴니아2
- 마이크로소프트
- 훈스닷넷
- 윈도데브
- 스마트폰
- 실버라이트 코리아
- 안드로이드
- 루나네스
- windows mobile 6.5
- 지승욱
- 윈모데브
- 헤이맨
- 소년포비소프트
- 황광진
- 신석현
- 쉐어포인트코리아
- Today
- Total
소년포비의 세계정복!!
[C#] 네트워크 정보 구하기 본문
using System;
using System.Net;
using System.Management;
namespace GetIPCS
{
/// <summary>
/// Gets IP addresses of the local machine
/// </summary>
class classGetIPCS
{
/// <summary>
/// Gets IP addresses of the local machine
/// </summary>
[STAThread]
static void Main(string[] args)
{
ManagementObjectSearcher query = new ManagementObjectSearcher
(”SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=’TRUE’”);
ManagementObjectCollection queryCol = query.Get();
foreach (ManagementObject mo in queryCol)
{
string[] address = (string[])mo["IPAddress"];
string[] subnets = (string[])mo["IPSubnet"];
string[] defaultgateways = (string[])mo["DefaultIPGateway"];
Console.WriteLine(”Network Card: {0}”, mo["Description"]);
Console.WriteLine(” MAC Address: {0}”, mo["MACAddress"]);
foreach (string ipaddress in address)
{
Console.WriteLine(” IP Address: {0}”, ipaddress);
}
foreach (string subnet in subnets)
{
Console.WriteLine(” Subnet Mask: {0}”, subnets);
}
foreach (string defaultgateway in defaultgateways)
{
Console.WriteLine(” Gateway: {0}”, defaultgateway);
}
}
}
}
}
'윈도우폰 세상 > Windows Phone' 카테고리의 다른 글
| [C#] 파일전송의 예제 (0) | 2009.10.26 |
|---|---|
| [C#] 네트워크 alive 상태검사 (0) | 2009.10.26 |
| [C#]ListView에서 선택된 곳의 내용 가져오기 (0) | 2009.10.24 |
| [Windows Mobile]가속센서(Accelerometer API) (0) | 2009.10.24 |
| [Windows Mobile] 방향전환(Orientation API) (0) | 2009.10.24 |