본문 바로가기

전체 글156

[vb.net] 델리 게이트(Delegate) 선언 방법과 간단한 예제 *델리 게이트(Delegate)- 대리자 로써 C 언어나 C++ 언어를 공부한 사람이라면 쉽게 접할 수 있는 함수 포인터와 비슷한 기능을 합니다. 또한 콜백 함수 기능 역할도 수행*델리 게이트 선언 방법과 간단한 예제 Public Class Form1 Delegate Function DelegateFunctionA(ByVal a As Integer, ByVal b As Integer) As Integer Delegate Function DelegateFunctionB(ByVal a As Integer) As String Delegate Sub DelegateSubA(ByVal a As Integer, ByVal b As Integer) Private Sub Button1_Click(ByVal sender.. 2022. 11. 30.
[VB.NET] 다른 응용 프로그램 실행(Run) 및 종료(Kill) 'example : 1 Dim SDP As System.Diagnostics.Process '// 응용프로그램 실행 SDP = System.Diagnostics.Process.Start(Path.Combine(Application.StartupPath, "tem.exe")) '// 프로세스 종료 SDP.Kill() 'example : 2 '// API 선언 Public Declare Function ShellExecuteA Lib "shell32.dll" ( ByVal hWnd As IntPtr, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal.. 2022. 11. 4.
[vb.net] 10진수에서 n진수 변환 2진수에서 38진수 까지 변환할 수 있는 함수입니다.39진수 이상은 사실 억지입니다. ㅎㅎ Public Function Division(ByVal number As Long, ByVal convert As Integer, Optional solution As String = "") As String Dim remainder As Integer = number Mod convert solution = ConvertToSymbol(remainder) & solution number = number / convert If number > convert Then solution = Division(number, convert, solution) Else solution = ConvertToSymbol(numbe.. 2022. 10. 28.
[vb.net] ArgumentException 클래스 / 오류(Error)를 리턴 Example: Imports System Public Class Example Private Shared Sub Main() ' Define some integers for a division operation. Dim values = {10, 7} For Each value In values Try Console.WriteLine("{0} divided by 2 is {1}", value, DivideByTwo(value)) Catch e As ArgumentException Console.WriteLine("{0}: {1}", e.GetType().Name, e.Message) End Try Console.WriteLine() Next End Sub Private Shared Function Div.. 2022. 10. 15.
[vb.net] 동적 DLL 폼 (Control) 불러오기 및 클래스 (Class) 함수 불러오기 예제 Imports System.IO Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim SRA As System.Reflection.Assembly Dim FATabStrip As Object = Nothing Dim FATabStripItem As Object = Nothing Dim Class1 As Object = Nothing Dim mt As System.Reflection.MethodInfo = Nothing SRA = System.Reflection.Assembly.LoadFile(Path.Combine(Application.StartupPath, "TabStrip.dl.. 2022. 10. 13.
[vb.net] IWebDriver chrome.exe 지정 및 user data, profile 경로 지정하기 CHROME_PATH 경로에 chrome.exe가 존재하면 chrome 경로를 설정하고 그 하위 폴더에 user_data_dir을 지정합니다.CHROME_PATH 경로에 chrome.exe가 존재하지 않으면 CHROME_PATH 가 "--user-data-dir"이 됩니다 Dim profile_path As String = nhnID Dim user_data_path As String = "" If File.Exists(Path.Combine(CHROME_PATH, "chrome.exe")) Then chromeOptions.BinaryLocation = Path.Combine(CHROME_PATH, "chrome.exe") user_data_path = CHROME_PATH & "\user_data_p.. 2022. 10. 9.
[vb.net] 마우스 드레그로 컨트롤 사이즈 변경 / 영역 사이즈 변경 Private Sub Panel_x_MouseDown(sender As Object, e As MouseEventArgs) Handles Panel9.MouseDown, Panel8.MouseDown, Panel7.MouseDown If sender Is Panel9 Then Windows.Forms.Cursor.Current = Cursors.HSplit Else Windows.Forms.Cursor.Current = Cursors.VSplit End If DirectCast(sender, Panel).Tag = {1, e.X, e.Y} End Sub Private Sub Panel_x_MouseUp(sender As Object, e As MouseEventArgs) Handles Panel9.Mou.. 2022. 10. 9.
[vb.net] Create Animated Gif Option Strict Off Imports System Imports System.Collections.Generic Imports System.Diagnostics Imports System.Text Imports System.IO Imports System.Collections Imports System.Collections.Specialized Imports System.Drawing Imports System.Drawing.Imaging Imports System.Drawing.Drawing2D Imports System.Drawing.Image Imports System.Threading Imports System.Runtime.Serialization Imports System.Window.. 2022. 10. 5.
[C#] DataGridView 홀수/짝수열 배경색 다르게 지정 for (int i = 1; i 2022. 9. 30.
[vb.net, C#] Selenium Webdriver에서 iFrame을 처리하는 방법: switchTo() WebDriver driver = new FirefoxDriver(); driver.get("http://demo.guru99.com/test/guru99home/"); driver.manage().window().maximize(); driver.switchTo().frame("a077aa5e"); 웹 요소로 프레임으로 전환: 웹 요소를 사용하여 iframe으로 전환할 수도 있습니다. driver.switchTo().frame(WebElement); 상위 프레임으로 돌아가려면 switchTo().parentFrame()을 사용하거나 기본(또는 대부분의 상위) 프레임으로 돌아가려면 switchTo().defaultContent()를 사용할 수 있습니다. driver.switchTo().parentFram.. 2022. 9. 24.
[vba] Export Excel to Access Sub program1472() Dim acc As Object Set acc = CreateObject("Access.Application") acc.OpenCurrentDatabase ThisWorkbook.Path & "\DB.accdb" acc.DoCmd.TransferSpreadsheet _ TransferType:=0, _ SpreadSheetType:=acSpreadsheetTypeExcel12Xml, _ TableName:="program1472", _ Filename:=Application.ActiveWorkbook.FullName, _ HasFieldNames:=True, _ Range:="tem$A1:B10" acc.CloseCurrentDatabase acc.Quit Set acc .. 2022. 9. 19.
[vb.net] MakeTransparent 이미지 지정한 컬러 투명하게 만들기 img.MakeTransparent(Color.White) 2022. 9. 19.
[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.