C#.NET 강좌와Tip 게시판입니다. - 시삽보기

제목: [유용한팁] 컴퓨터 재부팅 제어하기
글쓴이: HOONS
평점: 없음
조회: 1742
최초 출처는 정확히 어디인지 모르겠습니다.
이 팁은 데브피아에서 가져왔습니다.

try

{

    ConnectionOptions co = new ConnectionOptions();

    co.Username = "해당 컴퓨터 관리자격의 아이디";

    co.Password = "비밀번호";

    System.Management.ManagementScope ms = new System.Management.ManagementScope("\\\\" + txt_ip.Text.Trim() + "\\root\\cimv2", co);      



    //Query remote computer across the connection

    System.Management.ObjectQuery oq = new System.Management.ObjectQuery("SELECT * FROM Win32_OperatingSystem");

          

    ManagementObjectSearcher query1 = new ManagementObjectSearcher(ms,oq);

    ManagementObjectCollection queryCollection1 = query1.Get();            



    foreach( ManagementObject mo in queryCollection1 )

    {

        string[] ss={""};

        mo.InvokeMethod("Reboot",ss);

        listBox1.Items.Add(mo.ToString());

    }

  }

  catch(Exception ex)

  {

    MessageBox.Show(ex.Message);

  }
작성자 정보

글등록 +12 6102
덧글등록 +3 2535
이름: HOONS(hoons )

Level 99
 [EXP.만랩 ]


메일: hoonsbara골뱅이hanmail.net

홈페이지: blog.hoons.kr
자기소개
Kyoung Hoon, Park
INETA 국제닷넷 유저그룹 리더
Twitter(http://twitter.com/_hoons)
HOONS닷넷(http://www.hoons.kr) 운영자
HOONS의 닷넷 프로필러(http://blog.hoons.kr)

글 공유하기 |
 tweet facebook
2004-06-01 오전 9:16:12
IP: 211.255.8.11
        
트랙백 주소 : http://www.hoons.kr/418/BoardTrackback.aspx ()
등록된 트랙백 0

나도한마디
사용자
글등록 +1236  덧글등록 +1214
조현상            [2007-07-31]
Level 20
 [EXP.10/70]
ConnectionOptions 이걸 사용하려면,
Namespace: System.Management
Assembly: System.Management (in system.management.dll)

필요합니다~ 잘봤습니다.
사용자
글등록 +120  덧글등록 +17
루피넬            [2010-03-03]
Level 2
 [EXP.5/16]
잘 봤습니다.
사용자
글등록 +120  덧글등록 +110
티제이알            [2010-05-07]
Level 2
 [EXP.14/16]
감사합니다.
태그로 엮인글 리스트
글리스트


사용자 정보

close