C# 외부프로그램 실행시키기 - 간단한 방법
Process.Start(@"C:\Windows\notepad.exe");
- C# Programming
- · 2022. 5. 26.
C# 엑셀 열 정렬하기
Range rg = workSheet.Range["A:A"]; rg.HorizontalAlignment = XlHAlign.xlHAlignCenter;
- C# Programming
- · 2022. 5. 6.
Process.Start(@"C:\Windows\notepad.exe");
Visual Studio NuGet 패키지 관리자에서 System.Text.Json 을 설치한다 변환 예제) class JsonData { public string Name { get; set; } public int Age { get; set; } } private void button2_Click(object sender, EventArgs e) { var jsonData = new JsonData { Name = "Kim", Age = 2540, }; string jsonString = JsonSerializer.Serialize(jsonData); Console.Write(jsonString); // 읽기 var djsonData = JsonSerializer.Deserialize(jsonStri..
Range rg = workSheet.Range["A:A"]; rg.HorizontalAlignment = XlHAlign.xlHAlignCenter;
Application AppExcel = null; Workbook workBook = null; Worksheet workSheet = null; try { AppExcel = new Application { Visible = true }; workBook = AppExcel.Workbooks.Add(); workSheet = workBook.Worksheets.Add(Before: workBook.Worksheets.Item[1]); // 여기에 코드를 작성하시오 workBook.SaveAs(@"d:\"+ DateTime.Now.ToString("HHmmss")+".xlsx", XlFileFormat.xlWorkbookDefault); } catch (Exception e) { } finally { ..
using System.Reflection; using System.Windows.Forms; namespace WindowsFormsApp1 { public static class Extensions { public static void DoubleBuffered(this Control control, bool enabled) { var prop = control.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); prop.SetValue(control, enabled, null); } } }
using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApp1 { internal class FlickerFreeListBox : ListBox { public FlickerFreeListBox() { this.SetStyle( ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); this.DrawMode = DrawMode.OwnerDrawFixed; } protected override void OnDrawItem(DrawItemEventArgs e) { if (this.Items.Count > 0) { ..