본문 바로가기

전체 글165

[vb.net] PNG 리소스를 폼 아이콘으로 사용 img = My.Resources.pong img.MakeTransparent(Color.White) Me.Icon = Icon.FromHandle(img.GetHicon) 2022. 9. 19.
[최저가] 엡손 블루투스 라벨 프린터 87,720원 엡손 블루투스 라벨 프린터, LW-C410 / 포스팅일 기준 1개 87,720원 >> 클릭 2022. 9. 8.
[vb.net] Thread Example Public nhnLogin_Thread As Thread Private Sub m_cmd_login_Click(sender As Object, e As EventArgs) Handles m_cmd_login.Click If (nhnLogin_Thread IsNot Nothing AndAlso nhnLogin_Thread.IsAlive) Then Return CHROME_DRIVER_PATH = m_tb_7.Text If Len(Dir(APP_PRODUCT_PATH, vbDirectory)) = 0 Then LOG("경로 설정이 잘못되었습니다.",, True, True) : Return ElseIf Not File.Exists(Path.Combine(CHROME_DRIVER_PATH, "chromedri.. 2022. 9. 8.
[VB.NET] XML Parsing(파싱) - XML 추출하기 아래외 같은 XML 자료가 있을경우 updatecheck의 Version을 파싱할려고 합니다. ​​아래와 같이 파싱하면 됩니다.Dim RP As nhnRequestParameters = DirectCast(Deserialize(profileName, New nhnRequestParameters), nhnRequestParameters) RP.Url = "https://update.googleapis.com/service/update2?" RP.SetHeaders = "Host: update.googleapis.com" RP.SetPostData = "" RP.nhnWinHttp() Dim DocumentXml As New Xml.XmlDocument DocumentXml.LoadXml(RP.Respons.. 2022. 8. 19.
[WinHttp] WinHttpRequest 어셈블리 Interop.WinHttp, Version=5.1.0.0 Public Interface IWinHttpRequest Property [Option]([Option] As WinHttpRequestOption) As Object ReadOnly Property ResponseBody As Object ReadOnly Property ResponseText As String ReadOnly Property StatusText As String ReadOnly Property Status As Integer ReadOnly Property ResponseStream As Object Sub SetAutoLogonPolicy(AutoLogonPolicy As WinHttpRequestAutoLogon.. 2022. 8. 19.
[php] openssl encrypt/decrypt(AES-256-ECB) ?     $iv = '8746376827619797';    $key = "40ea168bdf014de783fb9a6640448bff";     function encrypt($original_string, $crypt_key, $crypt_iv) {        $option = 0;        $cipher_algo = "AES-256-ECB";        return openssl_encrypt($original_string, $cipher_algo, $crypt_key, $option, $crypt_iv);    }     function decrypt($encrypted_string, $crypt_key, $crypt_iv) {        $option = 0;        $cipher.. 2022. 8. 9.
[php] openssl encrypt/decrypt(AES-256-ECB) function encrypt($plaintext, $password) { $method = "AES-256-ECB"; $key = hash('sha256', $password, true); $encrypt_iv = openssl_random_pseudo_bytes(16); $ciphertext = openssl_encrypt($plaintext, $method, $key, OPENSSL_RAW_DATA, $encrypt_iv); $hash = hash_hmac('sha256', $ciphertext . $encrypt_iv, $key, true); return $encrypt_iv . $hash . $ciphertext; } function decrypt($ivHashCiphertext, $passwo.. 2022. 8. 9.
[vb.net] PlatformCheck Imports System Imports System.Management Imports System.Runtime.InteropServices Public Class PlatformCheck Public Sub New() MyBase.New() End Sub Public Shared Function GetBinPath() As String Return String.Concat(If(PlatformCheck.Is64Bit(), "x64", "x86"), "/appname.exe") End Function Private Shared Function GetEnabledXStateFeatures() As Long End Function Public Shared Function GetSIMDAvailable() .. 2022. 7. 26.
[vb.net] Assembly GUID 가져오기 Imports System.Runtime.InteropServices Module _ASM_GUID_ Public Function ASM_GUID() As String Dim asm As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly() ''The following line (part of the original answer) is misleading. ''**Do not** use it unless you want to return the System.Reflection.Assembly type's GUID. 'getGUID = assembly.[GetType]().GUID.ToString() '//fea961de-2778-4732-8d.. 2022. 7. 9.
[vb.net] "하드코딩"과 "소프트코딩"(로딩) 오래간만에 질문이 올라온 글을 보다가 아래와 같은 소스를 발견하였다.​ Select Case m_cmbSaveAs.Text Case "*.bmp" m_bitmap.Save(strFileName, ImageFormat.Jpeg) Case "*.jpg" m_bitmap.Save(strFileName, ImageFormat.Jpeg) Case "*.gif" m_bitmap.Save(strFileName, ImageFormat.Gif) Case "*.tif" m_bitmap.Save(strFileName, ImageFormat.Tiff) End Select 이와 같은 소스를 아래처럼 줄일 수 있다 Dim extension As String = IO.Path.GetExtension(strFileName).ToLo.. 2022. 6. 29.
[vb.net] URL 이미지 Image 변환 및 저장 Dim URL As String = "http://program1472.com/data/common/6e78fa096f9750e12db6.png"Dim img As Image = System.Drawing.Image.FromStream(Net.WebRequest.Create(URL).GetResponse().GetResponseStream())img.Save(APP_PRODUCT_PATH & "\test.png", Imaging.ImageFormat.Png) 또는 Dim URL As String = "http://program1472.com/data/common/6e78fa096f9750e12db6.png"Dim img As Image = Bitmap.FromStream(New IO.MemoryStrea.. 2022. 6. 26.
[vb.net] DataGridView 헤더 병합 dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing dgv.ColumnHeadersHeight *= 2 AddHandler dgv.Paint, Sub(ByVal sd As Object, ByVal ee As PaintEventArgs) Dim monthes As String() = {"Total", "Correct", "Wrong", "Score"} Dim j As Integer = 3 Dim pDGV As DataGridView = CType(sd, DataGridView) Try While j 2021. 5. 2.
[vb.net] Merge DataGridView Cells / DataGridView 셀병합 HMergedCell.vb Imports System Imports System.Collections.GenericImports System.ComponentModelImports System.DataImports System.DrawingImports System.TextImports System.Windows.FormsImports System.DiagnosticsImports System.Drawing.Drawing2D Public Class HMergedCell Inherits DataGridViewTextBoxCell Private m_nLeftColumn As Integer = 0 Private m_nRightColumn As Integer = 0 Private m_nTopRow As Int.. 2021. 5. 2.
[VBNET] 크로스 스레드 (Cross Thread) 예제 '// Example 컨트롤 삽입 Dim DL As New DGV_LIST If CType(Me.Panel10.Controls("RP"), DGV_LIST).GroupBox1.InvokeRequired = True Then CType(Me.Panel10.Controls("RP"), DGV_LIST).GroupBox1.Invoke(CType(Function() CType(Me.Panel10.Controls("RP"), DGV_LIST).GroupBox1.Controls.Add(DL) End Function, MethodInvoker)) Else CType(Me.Panel10.Controls("RP"), DGV_LIST).GroupBox1.Controls.Add(DL) End If '// Example 01.. 2021. 5. 2.
[vb.net] DataTable Count / Sum / Distinct '// 정렬 후 유일한 값 추출 Dim DA() As String = D.Select("", "testPaperNum ASC").CopyToDataTable.AsEnumerable().Select(Function(DR) Return DR.Field(Of Long)("testPaperNum").ToString End Function).Distinct().ToArray '// 특정 조건 데이터 갯수 Count = D.Select(String.Format("[testPaperNum]='{0}' AND [Difficulty]='{1}' AND [correct]='{2}'", DA, DB, 0)).Length 또는 Count = D.Compute("count(testPaperNum)", String.Format(.. 2021. 5. 2.
vb.net 컨트롤이 자신이 만들어진 스레드가 아닌 스레드에서 액세스되었습니다. '쓰레드 생성을 위한 변수 선언 Dim t As System.Threading.Thread '크로스 쓰레드 작업을 위한 콜백 대리자 선언 Delegate Sub textCallBack(ByVal state As Object) '콜백 대리자 변수 선언 Dim cbFunc As textCallBack Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '쓰레드 생성 후 newThreadFunc 호출 t = New System.Threading.Thread(AddressOf newThreadFunc) '쓰레드 시작 & 인수 = "Hello World" t.Start(CObj("H.. 2021. 5. 2.
[vb.net] TextBox Ctrl+c and Ctrl+v how to implement Private Function SET_TEXT_BOX_CLIPBOARD_SHORTCUTS(ByRef f As Form) As Boolean Dim C As Control = f Do C = f.GetNextControl(C, True) Try Select Case True Case C Is Nothing Case TypeOf C Is TextBox AddHandler CType(C, TextBox).KeyUp, AddressOf TextBox_KeyUp End Select Catch ex As Exception el.WriteToErrorLog(ex.Message, ex.StackTrace, "Error") End Try Loop Until C Is Nothing End Function Private S.. 2021. 3. 18.
[VB.NET] Sort Examples: Arrays and Lists - Dot Net Perls VB.NET program that uses Array.Sort on stringsModule Module1 Sub Main() ' Create an array of String() with 3 elements. Dim vegs As String() = New String() {"turnip", "onion", "corn"} ' Use the System.Array.Sort shared method. System.Array.Sort(vegs) ' Loop through the results and print them with Console.WriteLine. For Each value As String In vegs Console.WriteLine(value) Next End Sub End Module .. 2021. 3. 18.
[VB.NET] program that uses WithEvents, Handles Module Module1 ' An instance of the Event class. WithEvents EventClassInstance As New EventClass Sub PrintTestMessage() Handles EventClassInstance.TestEvent ' This method handles the TestEvent. Console.WriteLine("Test Message Being Printed...") End Sub Sub PrintTestMessage2() Handles EventClassInstance.TestEvent ' This method also handles the event. Console.WriteLine("Test Message 2 Being Printe.. 2021. 3. 10.
[MySQL] MySQL 공백, 탭, 라인피드, 캐리지리턴 등을 제거하는 방법 MySQL 공백, 탭, 라인피드, 캐리지리턴 등을 제거하는 방법 필드값 변경 함수 replace(필드명, 변경할 문자, 변경될 문자) - '필드명'에 해당하는 레코드에서 '변경할 문자'를 모두 '변경될 문자'로 변경한다. 1. 공백제거(앞/뒤의 공백을 제거한다) - update table set field = replace(field, ' ', ''); * table은 테이블명, field는 필드명이다. 2. 개행문자 제거 - update table set field = replace(field, '\r\n', ''); 3. 탭( Tab - char(9) ) 제거 - update table set field = replace(field, char(9), ''); - field 값에 탭(char(9))이 .. 2021. 2. 24.
[MySQL] 내용 추가 / 값 추가 UPDATE `job_order` SET `InvoiceNumber` = concat(`InvoiceNumber`, '추가할값') WHERE `uid` = 1 2021. 2. 23.