string Today = ""; Today += DateTime.Now.Year + "-"; Today += (DateTime.Now.Month.ToString().Length == 1) ? "0" + DateTime.Now.Month : DateTime.Now.Month + "-"; Today += (DateTime.Now.Day.ToString().Length == 1) ? "0" + DateTime.Now.Day : DateTime.Now.Day.ToString(); 삼한 연산자를 이용하여 조금 줄려봤지만... 그래도 좀.... 영 찝찝한건 머지... 결과는 오늘 기준 2009-03-02 입니다~
Function Cutstring(ByVal Text As String, ByVal startLenth As Integer, Optional ByVal Lenth As Integer = 0) As String Dim StringArray() As Byte '임시 바이트 배열 Lenth = IIf(Lenth = 0, System.Text.Encoding.GetEncoding("korean").GetByteCount(Text), Lenth) ' IIf(true/false, true 일경우 GetByteCount(Text)로 Text의 길이를 저장 , false일경우 lenth를 그대로 저장 StringArray = System.Text.Encoding.GetEncoding("korean").GetBytes(..
어떤 경우라고 하기 모호하지만 나의 입장의 경우 Textbox_1 ~ Textbox_5까지 값을 넣어야할 때 아래와 같이 사용하면 된다. For index As Integer = 1 To 5 Me.Controls("Textbox_" & index).Text = index Next for (int i = 1; i < 5; i++) { this.Controls["Textbox" + i].Text = i; } 간단한 팁이다 ^^;
Windows Application .NET Framework1. How to get the path for "My Documents" and other system folders? 2. How to get the path to my running EXE? 3. How to determine which operating system is running? 4. How to get a file's name from the complete path string? 5. How to get a file's extension from the complete path string? 6. What is difference beween VB.NET and C#.NET? 7. How to find whether your ..
Microsoft.Office.Interop.Excel.Application App; Microsoft.Office.Interop.Excel.Worksheet Worksheet; Microsoft.Office.Interop.Excel.Workbook Wbook; App = new Microsoft.Office.Interop.Excel.Application(); App.Visible = true; Wbook = (Microsoft.Office.Interop.Excel.Workbook)(App.Workbooks.Add(System.Reflection.Missing.Value)); Worksheet = Wbook.ActiveSheet; for (int i = 0; i < dataGridView.RowCount..
public static void AddEmployee( string lastName, string firstName, string title, DateTime hireDate, int reportsTo, string photoFilePath, string connectionString) { byte[] photo = GetPhoto(photoFilePath); using (SqlConnection connection = new SqlConnection( connectionString)) SqlCommand command = new SqlCommand( "INSERT INTO Employees (LastName, FirstName, " + "Title, HireDate, ReportsTo, Photo) ..
프로젝트 관리 하기 위해서 설치했던 SVN이 클라이언트가 유료여서 찾아보다가 발견한 AnkhSVN. 기본 기능은 비슷한거 같고 사용할때도 편한거 같다 . What's New Download AnkhSVN 2.0 (2.0.5250) (VS 2005+) Download AnkhSVN 1.0.4 (VS 2002 and VS 2003) Download daily builds. AnkhSVN is a Subversion SourceControl Provider for Visual Studio. The software allows you to perform the most common version control operations directly from inside the Microsoft Visual Stud..
Form 속성에서 KeyPreview 값을 True로 선택한 뒤 Form Event에서 KeyDown 이벤트를 선택하고 아래와 같이 이벤트를 작성합니다. Private Sub _KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.F1 '조회 CmdSearch_Click(sender, e) Case Keys.F2 '등록 CmdInsert_Click(sender, e) Case Keys.F3 '삭제 CmdDelete_Click(sender, e) Case Keys.F4 '종료 CmdExit_Click(sender, e) En..