본문 바로가기

프로그래밍/C#24

[C#] opendialog 함수, OFD 간단한 사용법 private void button1_Click(object sender, EventArgs e) { OpenFileDialog OFD = new OpenFileDialog(); if (OFD.ShowDialog() == DialogResult.OK) { textBox1.Clear(); textBox1.Text = OFD.FileName; } } button, textbox를 한개씩 추가 후 button쪽 소스코드에 삽입. 아주 잘된다. 짞짞짞짜짝 2021. 3. 16.
[C#] 현재 경로, user 경로 등 유용한 경로 모음 m.blog.naver.com/PostView.nhn?blogId=zic6188610&logNo=221032462444&proxyReferer=https:%2F%2Fwww.google.com%2F [C# 실행경로, 시작경로, 현재경로] 사용 방법 안녕하세요. 여러분 '창미니'입니다. 제가 이번에 알려드릴 소스 코딩은 C# 에서 실행경로, 시작경로, 현... blog.naver.com insurang.tistory.com/171 2021. 3. 16.
[C#] 파일이름 변경하기 infodbbase.tistory.com/118 www.delftstack.com/ko/howto/csharp/how-to-rename-a-file-in-csharp/ using System.IO; private void button1_Click(object sender, EventArgs e) { string oldFile = null; string newFile = null; string filePath = null; oldFile = filePath + "\\" + oldFile; newFile = filePath + "\\" + newFile; System.IO.File.Move(oldFile, newFile); MessageBox.Show("Change!"); } 2021. 3. 16.
[C#] F1을 누르면 메세지 박스가 실행되는 프로그램 private void Form1_Load(object sender, EventArgs e) { this.KeyPreview = true; this.KeyDown += new KeyEventHandler(Form1_KeyDown); } void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode.ToString() == "F1") { MessageBox.Show("F1 pressed"); } } 2021. 3. 16.
[C#] 키보드 출력을 이용한 매크로 docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys.send?redirectedfrom=MSDN&view=net-5.0#System_Windows_Forms_SendKeys_Send_System_String_ SendKeys.Send(String) Method (System.Windows.Forms) Sends keystrokes to the active application. docs.microsoft.com 11cc.tistory.com/8 Namespace: System.Windows.Forms SendKeys.Send("A"); //A키 입력 SendKeys.Send("{enter}"); //Enter키 입력 SendKey.Send.. 2021. 3. 16.
[C#][Selenium] 설치하기, 코스트코 로그인 만들기 C#으로 셀레니움을 설치, 개발환경을 테스트 해보겠다. 크게 3가지를 해야한다. 1. Visual Studio 설치 2. Selenium 라이브러리 설치 3. 컴파일 및 실행 우선 1번이다. 나는 Visual Studio 2019 Community를 사용하고 있다. 이 버전은 무료이다. visualstudio.microsoft.com/ko/vs/ Visual Studio 2019 | 무료 다운로드 Visual Studio에서 코드 완성, 디버깅, 테스트, Git 관리, 클라우드 배포를 사용하여 코드를 작성할 수 있습니다. 지금 Community를 무료로 다운로드하세요. visualstudio.microsoft.com 여기서 다운로드 받을 수 있다. 그리고 다운로드 받을 때 그냥 C# 관련된 패키지는 전부.. 2021. 3. 13.