[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
[VB.NET] 웹브라우저 (WebBrowser)를 이용하여 HTML 소스 가져오기
2022. 5. 25. 16:19
프로그래밍/VB.NET
Dim strWeb as string = WebBrowser1.Document.Body.InnerHtml

[VB.NET] 한글 깨짐 (EUC-KR 인코딩)
2022. 5. 25. 16:18
프로그래밍/VB.NET
Import System.Web '상단에 선언 프로젝트(P) - 참조 추가(R)를 클릭해 주세요. 사진 순서대로 진행을 해주시면 됩니다. 순서대로 진행을 하셨다면 이제 소스 코드를 작성을 해주시면 됩니다. HttpUtility.UrlEncode("내용", Encoding.GetEncoding("EUC-KR")) 예전에 네이버 관련 된 프로그램을 제작할 때 한글 깨짐 현상이 있어서 올려놨던 게시글입니다.
[VB.NET] 리스트 뷰 선택한 인덱스 값 가져오기
2022. 5. 25. 16:14
프로그래밍/VB.NET
For i as Integer = 0 to ListView1.SelectedItems.Count - 1 Msgbox(ListView1.SelectedIndices(i)) Next i
[VB.NET] 순차적 값 가져오기
2022. 5. 25. 16:13
프로그래밍/VB.NET
Dim arrData(4) as string arrData(0) = "원하는 값" arrData(1) = "원하는 값" arrData(2) = "원하는 값" arrData(3) = "원하는 값" arrData(4) = "원하는 값" For i as Integer = 0 to UBound(arrData) msgbox(arrData(i)) next i 이런 식으로 소스코드를 작성을 하게 된다면 순차적으로 0번부터 4번까지의 값을 메시지 박스로 표시를 해줍니다.