본문 바로가기

분류 전체보기203

파일 사용여부 확인 로직(Class) Imports System.IO Public Class IsAccess Public Shared Function IsAccessAble(ByVal path As String) As Boolean Dim fs As FileStream = Nothing Try fs = New FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None) Catch __unusedIOException1__ As IOException Return False Finally If fs IsNot Nothing Then fs.Close() End If End Try Return True End Function End Class 2019. 12. 9.
CMD에 원하는명령어를 보내자. 이강좌는 CodeHighligher 와 함께합니다. 어... 두가지버전을 준비해봤습니다. 첫번쨰 버전은 FindWindow 를 이용한 명령어보내기 두번쨰 버전은 프로세스 이름을 이용한 명령어보내기 FindWindow 를 이용한 명령어보내기 우선 아래의 네임스페이스 코드를 맨위에 적어서 dll을 사용할수있도록 해주세요. Imports System.Runtime.InteropServices 그후 폼코드창 안에 Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As.. 2019. 12. 9.
에러 발생 시 문자 발송하는 로직(URL이용) Private Sub SendException(ByVal 프로그램명 As String) Try Dim Sender, ToCellPhoneNum, SendMsg As String Sender = "01063485390" ToCellPhoneNum = "01063485390;01062426051;01093847722;01036363026" '발송하는휴대폰번호가 2개이상일 경우 휴대폰번호 사이에 ;(세미콜론)이 들어감 SendMsg = $"[시스템통보] {vbNewLine}- 시스템명: {프로그램명}{vbNewLine}- 오류내용: 종료{vbNewLine}-오류시간 : {Now}" Dim E_ToCellPhoneNum, E_SendMsg As String E_ToCellPhoneNum = Uri.EscapeD.. 2019. 12. 4.
RadGridView 컨트롤 색상변경 예제 '-- 패널에 선그리기를 위한 함수(공통합수) Public Sub panelLineColor(ByVal 패널 As Panel) '' -- 패널 사각형 그리기 Dim myGraphices As Graphics = 패널.CreateGraphics Dim myPen As Pen myPen = New Pen(Brushes.LightGray, 1) '-- 색상하고 굵기 myGraphices.DrawLine(myPen, 0, 패널.Height, 0, 0) '-- 왼쪽줄 myGraphices.DrawLine(myPen, 0, 0, 패널.Width, 0) '-- 상단줄 myGraphices.DrawLine(myPen, 패널.Width - 1, 패널.Height, 패널.Width - 1, 0) '-- 오른쪽세로 myGr.. 2019. 12. 4.