VB.NET 에서 C#의 @"STRING" 따라하기 VB.NET 에서 <STRING> 문자열</STRING> 과 같이써서 vbcrlf 라던지 문자열내 쌍따옴표 입력시 두번입력과 같이 번거로운 작업을 할필요가 없네요 Module Module1 Sub Main() Dim str1, str2 As String str1 = """첫번째 문자열""" & vbCrLf & """첫번째 문자열 끝""" str2 = <string>"두번째 문자열" "두번째 문자.. 프로그래밍언어/VB.NET 2014.05.25
네이버 웹툰 다운 Imports System.Text.RegularExpressions Module Module1 Sub Main() Dim winhttp As New WinHttp.WinHttpRequest Dim strURL As String = "http://m.comic.naver.com/webtoon/detail.nhn?titleId=358422&no=" Dim regex1 As New Regex("lazy-src=""(.*?)"" id=""toon_") Dim matches As MatchCollection For page = 1 To 140 ' 게시물 한계 winhttp.Open("GET", strURL & page) winhttp.Send() matches.. 프로그래밍언어/VB.NET 2014.05.19
ReadWritingMemory Imports System.Windows.Forms Module ReadWritingMemory Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer Private Declare Function WriteProcessMemory1 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As.. 프로그래밍언어/VB.NET 2014.05.17
좌표값 픽셀가져오기 Function GetScreenPixel(ByVal pt As Point) As Color Using bmp As New Bitmap(1, 1) Using g As Graphics = Graphics.FromImage(bmp) g.CopyFromScreen(pt, Point.Empty, New Size(1, 1)) Return bmp.GetPixel(0, 0) End Using End Using End Function 프로그래밍언어/VB.NET 2014.03.28
마우스좌표 가져오기 Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Int32 Dim p As POINTAPI GetCursorPos(p) Dim str As String = p.x & " " & p.y 프로그래밍언어/VB.NET 2014.03.28
문자열로 Sub 호출하기 http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=45&MAEULNO=18&no=511&page=1 이런저런 코딩중에 좀 더 간단한 Sub호출을 위해 방법을 찾다가 알게 된건데요... 항상 클릭 이벤트를 받아서 select case 등으로 각각의 서브를 호출했었는데 간단히 문자열로 Sub를 호출하는 방법이 있었네요같은 클래스 안에.. 프로그래밍언어/VB.NET 2014.03.23
변수이름으로 컨트롤 접근 출처 : http://www.devpia.com/Maeul/Contents/Detail.aspx?BoardID=45&MAEULNo=18&no=509&ref=509 Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim myControl As String = "Label" Dim i As Integer = 3 FindByName(Of Label)(myControl + i.ToString()).Text = "test" '(myControl + i.ToString()).FindByName(Of Label)(Me).Text .. 프로그래밍언어/VB.NET 2014.03.19
배열내 갯수 출력 배열내의 텍스트를 종류별로 정리해서 수치를 출력.. Module Module1 Sub Main() Dim str As String() = {"aaa", "bbb", "bbb", "돌쇠", "ccc", "ddddddd", "aaa", "aaa", "돌쇠"} Dim dic As New Dictionary(Of String, Integer) For i = 0 To str.Length - 1 If dic.ContainsKey(str(i)) = False Then dic.Add(str(i), 0) End If dic(str(i)) += 1 Next Dim pair As KeyValuePair.. 프로그래밍언어/VB.NET 2014.03.10
GetPixel 로 불러온값을 Color 로 변환 dim i as integer = 6421504dim c as colorc = System.Drawing.Color.FromArgb(i)Probably the Alpha channel is missing, so you'd have to usec = System.Drawing.Color.FromArgb(i or &Hff000000) 프로그래밍언어/VB.NET 2014.03.09