[JAVA] 메소드 (Method) 작성 방식
2022. 5. 25. 16:37
프로그래밍/JAVA
public static void main(String[] args) { System.out.println("Hello, world"); } public static void blahblahblah() { System.out.println("blahblahblah"); }
[C#] 체크 리스트 박스 아이템 체크하기/해제하기
2022. 5. 25. 16:36
프로그래밍/C#
for (int i = 0; i < chkListbox.CheckedItems.Count; i++) { listbox1.items.add(chkListbox.CheckedItems[i]); } for (int j = 0; j < chkListbox.CheckedIndices.Count;) { SetItemChecked(chkListbox.CheckedIndices[0], false); }
[C#] 순차적 값 가져오기
2022. 5. 25. 16:35
프로그래밍/C#
string[] arrData = new string[5]; arrData[0] = "내용"; arrData[1] = "내용"; arrData[2] = "내용"; arrData[3] = "내용"; arrData[4] = "내용"; for (int i = 0; i < arrData.Length; i++) { /* VB.NET에서는 UBound를 사용하였지만 C#에서는 Length를 사용한다. */ MessageBox.Show(arrData[i], "", MessageBoxButtons.OK, MessageBoxIcon.Information); } string[] arrData = {"내용", "내용" , "내용", "내용", "내용"}; for (int i = 0; i < arrData.Length; i+..

[C#] 메시지 박스
2022. 5. 25. 16:31
프로그래밍/C#
MessageBox.Show("내용", "메시지 박스 타이틀", "메시지 박스 표시", "메시지 박스 아이콘"); MessageBox.Show("안녕하세요", "Hi", "MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("안녕하세요", "Hi", "MessageBoxButtons.OKCancel, MessageBoxIcon.Information); MessageBoxButtons 부분의 값을 변경을 해주게 된다면 어느 부분이 바뀌시는지만 참고하시면 됩니다. MessageBoxIcon 부분의 값을 변경을 하시게 된다면 Hello 옆에 있는 아이콘 부분이 변경됩니다.
[VB.NET] 리스트 뷰 서브 아이템 글씨 색 변경
2022. 5. 25. 16:27
프로그래밍/VB.NET
For i as integer = 0 to listview1.items.count -1 '리스트뷰 스타일 설정 listview1.Items(i).UseItemStyleForSubItems = False listview1.items(i).subitems(1).ForeColor = Color.Red Next i
[VB.NET] 리스트 뷰 비교
2022. 5. 25. 16:26
프로그래밍/VB.NET
For i as integer = 0 to ListView1.Items.count -1 For j as Integer = 0 to ListView2.Items.count -1 if ListView1.Items(i).text = ListView2.Items(j).text then '서브아이템을 비교하고싶다면 Items(i).Subitems(숫자).text로 변경하시면 됩니다. msgbox("중복") else msgbox("중복X") end if next j next i For i as integer = 0 to ListView1.Items.count -1 For j as Integer = 0 to ListView2.Items.count -1 if ListView1.Items(i).Text.Contains(..
[VB.NET] 구글 드라이브 파일 다운로드
2022. 5. 25. 16:24
프로그래밍/VB.NET
Public Class DownloadFileThread Public Shared Function urldownloadtofile(ByVal pCaller As Integer, ByVal szurl As String, ByVal szfilename As String, ByVal reserved As Integer, ByVal callback As Integer) As Integer End Function End Class WebBrowser1.Naviagte("https://drive.google.com/uc?id=각자 파일마다 다르니 참고&export=download") '공유 링크가 아니라 공유 링크에서 다운로드 버튼을 눌렀을 때 링크를 넣으셔야 합니다. Dim strRes as string = We..
[VB.NET] 폰트가 있는지 확인 후 폰트가 없다면 폰트 설치
2022. 5. 25. 16:23
프로그래밍/VB.NET
Private Shared Sub RegisterFont(ByVal contentFontName As String) Dim fontDestination = Path.Combine(GetFolderPath(SpecialFolder.Fonts), contentFontName) 'C:\Windows\Fonts 부분과 그 안에 폰트가 설치되어 있는지 확인하는 코드 If Not File.Exists(fontDestination) Then '해당 경로에 파일이 존재하지 않다면 File.Copy(Path.Combine(Directory.GetCurrentDirectory(), contentFontName), fontDestination) '파일을 복사해서 C:\Windows\Fonts 부분에 넣어준다. Dim fon..
[VB.NET] 리스트에 있는 아이템을 CSV 파일로 저장하기
2022. 5. 25. 16:21
프로그래밍/VB.NET
For i as Integer = 0 To List.Items.Count - 1 Dim CSVWriter As New StreamWriter(Application.StartupPath & "\" & "파일명.csv") 'Application.StartupPath는 프로그램을 실행시킨 폴더 경로를 가져온다. CSVWriter.Write(List.Items(i).ToString & ", " & ", ") CSVWriter.WriteLine() CSVWriter.Close() Next i
[VB.NET] 리스트에 있는 아이템을 텍스트 파일(txt)로 저장하기
2022. 5. 25. 16:20
프로그래밍/VB.NET
Dim strData As String = "" For i = 0 To ListBox1.Items.Count - 1 strData += ListBox1.Items(i).ToString & vbNewLine 'strData 변수안에 리스트에 담긴 아이템을 추가한다, vbNewLine은 줄바꿈 My.Computer.FileSystem.WriteAllText(Application.StartupPath & "\" & "파일명.txt", strData, False) 'Application.StartupPath는 프로그램을 실행시킨 폴더 경로를 가져온다. Next i