728x90 반응형 C#26 C# - 설정 값 배열(array) 형태로 저장하고 불러오기 저장하기 string value = String.Join(",", intArray.Select(i => i.ToString()).ToArray()); Properties.Settings.Default.option_array = value; Properties.Settings.Default.Save(); 불러오기 int[] arr = Properties.Settings.Default.option_array.Split(',').Select(s => Int32.Parse(s)).ToArray(); 출처: https://stackoverflow.com/questions/1766610/how-to-store-int-array-in-application-settings How to store int[] array .. 2023. 2. 1. C# - dataGridView1 셀 값 수정하기 dataGridView1[1,1].Value="tes"; 출처: https://stackoverflow.com/questions/1516252/how-to-programmatically-set-cell-value-in-datagridview How to programmatically set cell value in DataGridView? I have a DataGridView. Some of the cells receive their data from a serial port: I want to shove the data into the cell, and have it update the underlying bound object. I'm trying something like th... stackov.. 2023. 2. 1. C# - 마이크로소프트 공식 UWP, WPF 자습서 (GUI 프로그래밍) 및 둘의 차이점 UWP 자습서 https://learn.microsoft.com/ko-kr/visualstudio/get-started/csharp/tutorial-uwp?view=vs-2022 자습서: Visual Studio 및 C#을 사용하여 UWP 앱 만들기 Visual Studio에서 XAML 및 C#을 사용하여 UWP 앱 만들기 learn.microsoft.com WPF 자습서 https://learn.microsoft.com/ko-kr/visualstudio/get-started/csharp/tutorial-wpf?view=vs-2022 C#에서 WPF를 사용하는 Hello World 앱 - Visual Studio (Windows) WPF(Windows Presentation Foundation) UI 프.. 2023. 1. 19. 셀레니움 - C#, 사용자의 기존 크롬 환경 조작하기 "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 var options = new ChromeOptions(); options.DebuggerAddress = "127.0.0.1:9222"; IWebDriver driver = new ChromeDriver(options); 출처: https://stackoverflow.com/questions/67560832/use-selenium-to-attach-to-a-manually-opened-browser Use Selenium to attach to a manually opened Browser I know, that such a question.. 2022. 11. 16. 셀레니움 - C#, Select Option 선택 Install-Package Selenium.Support // By Text (new SelectElement(driver.FindElement(By.XPath(""))).SelectByText(""); // By Value (new SelectElement(driver.FindElement(By.XPath(""))).SelectByValue(""); 출처: https://stackoverflow.com/questions/5278281/how-to-select-an-option-from-drop-down-using-selenium-webdriver-c How to select an option from drop down using Selenium WebDriver C#? I was trying for .. 2022. 10. 26. 셀레니움 - C#, 자바스크립트 실행 결과 가져오기 // Number var newScrollHeight = (long) js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight); return document.body.scrollHeight;"); // String string title = (string)js.ExecuteScript("return document.title"); 출처: https://stackoverflow.com/questions/18572651/selenium-scroll-down-a-growing-page Selenium - Scroll down a growing page I'm using Selenium with c#. Selenium usually can automat.. 2022. 10. 26. C# - textBox PlaceHolder 구현 https://www.youtube.com/watch?v=VFeYyC_4It0 private void textBox_naverid_Enter(object sender, EventArgs e) { if( textBox_naverid.Text == "아이디") { textBox_naverid.Text = ""; textBox_naverid.ForeColor = Color.Black; } } private void textBox_naverpw_Enter(object sender, EventArgs e) { if (textBox_naverpw.Text == "비밀번호") { textBox_naverpw.Text = ""; textBox_naverpw.PasswordChar = '●'; textBox_naverp.. 2022. 10. 26. C# - 멀티스레드에서 클립보드 기능(OLE) 사용하기 // 멀티스레드 함수 선언 mainThread = new Thread(work); mainThread.SetApartmentState(ApartmentState.STA); mainThread.Start(); // 멀티스레드 함수 내부 Clipboard.SetText("테스트"); 출처: https://taeminimini.tistory.com/m/437 Thread 내 에서 OLE 호출시 STAThreadAttribute C# Thread 하다보니 만들어놓은 쓰레드에 Clipboard를 사용하려고 하니 아래와 같이 오류가 발생했다. 😥 System.Threading.ThreadStateException: 'OLE 호출을 수행하려면 현재 스레드를 STA(단일 스레드 아파트) taeminimini.tisto.. 2022. 10. 19. C# - 모던 UI 프레임워크(MahApps.Metro) https://mahapps.com/ MahApps.Metro - Home Enhance the default controls MahApps.Metro overrides the default style of all common WPF controls and gives them a modern look. More than just styles MahApps.Metro also includes some custom controls based on concepts from Windows Phone, Windows 8 and Windo mahapps.com https://luckygg.tistory.com/302 [.Net] C# WinForm에서 Metro UI(Modern UI) Framework 적용하기(.. 2022. 10. 13. C# - 비주얼 스튜디오, 코드가 적용이 안되고 이전 것으로 실행 되는 경우 해결 방법 빌드(B) > 솔루션 정리(C) 2022. 10. 11. C# - 드래그 앤 드롭(Drag & Drop) public partial class Form1 : Form { public Form1() { InitializeComponent(); this.AllowDrop = true; this.DragEnter += new DragEventHandler(Form1_DragEnter); this.DragDrop += new DragEventHandler(Form1_DragDrop); } void Form1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy; } void Form1_DragDrop(object sender, DragEventAr.. 2022. 10. 9. C# - DateTime D-Day 구하기(TimeSpan) D-Day 구하기 System.DateTime Time = new System.DateTime(2022, 12, 05); TimeSpan resultTime = Time - DateTime.Now; Console.writeLine("D-Days: " + resultTime.Days); 파일 마지막 수정일 경과 일 구하기 DateTime LastWriten = File.GetLastWriteTime("memo.txt"); TimeSpan resultTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day) - new DateTime(LastWriten.Year, LastWriten.Month, LastWriten.Day); if.. 2022. 10. 8. 이전 1 2 3 다음 728x90 반응형