목록c# (21)
분노의 챔질
http://aforgenet.com/framework/downloads.html 기존의 AForge는 Uninstall을 하고 Setup을 해야 서로 충돌하지 않는다. 기본문법 //START MJPEGStream mjpegSource = new MJPEGStream('웹캠IP주소'); videoSourcePlayer1.VideoSource = mjpegSource; videoSourcePlayer1.Start(); //STOP videoSourcePlayer1.SignalToStop(); videoSourcePlayer1.WaitForStop(); videoSourcePlayer1.Stop(); //CAPTURE Bitmap bitmap = videoSourcePlayer1.GetCurrentVideo..
Ping pingSender = new Ping(); PingReply reply = pingSender.Send("192.168.0.4"); Console.WriteLine("Status :" + reply.Status); if (reply.Status == IPStatus.Success) { //성공 } else { //실패 }
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection moc = mc.GetInstances(); string MACAddress = String.Empty; foreach (ManagementObject mo in moc) { if (MACAddress == String.Empty) // only return MAC Address from first card { if ((bool)mo["IPEnabled"] == true) MACAddress = mo["MacAddress"].ToString(); } mo.Dispose(); } MACAddress = MACAddres..
프로그램 진입점에 아래와 같은 코드를 삽입한다. [STAThread] static void Main() { bool createdNew; Mutex dup = new Mutex(true, "MU", out createdNew); if (createdNew) { Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); dup.ReleaseMutex(); } }
1. 도구상자 > NotifyIcon 추가 2. 트레이아이콘 선택 (주의. 아이콘이 없으면 시스템 트레이에 나타나지 않습니다.) NotifyIcon Controller - Name : notifyIcon1 - Text : Hello - Icon : .ico 파일 아무거나 하나 가져오면 됩니다. 시스템 트레이 아이콘은 icon이 설정되어 있으면 프로그램 구동시 자동으로 트레이아이콘에 올라옵니다. 그렇기 때문에, 트레이아이콘을 설정하기 위한 작업은 별도의 작업은 없고, 폼을 안보이도록 Hide() 처리만 하면 됩니다. private void Form1_Resize(object sender, System.EventArgs e) { if (FormWindowState.Minimized == WindowState..
http://network.hanbitbook.co.kr/view.php?bi_id=229 1. 쓰레드는 무엇인가? http://network.hanbitbook.co.kr/view.php?bi_id=231 2. 다중 쓰레드 http://network.hanbitbook.co.kr/view.php?bi_id=233 3. 쓰레드 제어 http://network.hanbitbook.co.kr/view.php?bi_id=239 4. 쓰레드 기본 개념 http://network.hanbitbook.co.kr/view.php?bi_id=243 5. NT vs UNIX http://network.hanbitbook.co.kr/view.php?bi_id=246 6. 쓰레드 예외 처리 http://network.han..
KeyDown 이벤트에 작성한다. this.txtMemo.KeyDown += (sender, e) => { if (e.Modifiers == Keys.Control && e.KeyCode == Keys.V) { var clipboard = Clipboard.GetData(DataFormats.Text).ToString(); this.txtMemo.Text = clipboard; } }; 텍스트가 아닌 다른 데이터라면 DataFormats.Text을 데이터에 맞는 포멧으로 바꾸어주고 그에 따른 나머지 코딩부분은 각자 알아서~ ㅡ.ㅡ