본문 바로가기

전체 글203

프로세스 확인 Public Function IsProcessRunning(ByVal name As String) As Boolean For Each clsProcess As Process In Process.GetProcesses() If clsProcess.ProcessName.StartsWith(name) Then Return True End If Next Return False End Function 2020. 5. 8.
중복값 제거 방법 (List 이용) '중복값을 확인후 제거하기 위해 별도 List로 저장 Dim List As List(Of String) = New List(Of String) For i = 0 To count - 1 List.Add(Split(Split(s, "/")(i), "colorHex")(1)) Next '별도 List로 저장된 것중 중복값 제거한 값만 lsv에 추가 Dim N_List As List(Of String) = List.Distinct().ToList For j = 0 To N_List.Count - 1 lsv.Items.Add(N_List(j).ToString) Next 2020. 4. 7.
그리드뷰 전체 DB에 업로드하는 방법 Dim SqlConnnection As New SqlConnection() Dim cmd As New SqlCommand SqlConnnection.ConnectionString = dbstring cmd.CommandText = "Insert into TB_TWD_Phone_Img (ID, PN) Values (@ID, @PN)" cmd.Parameters.Add("@ID", SqlDbType.VarChar) cmd.Parameters.Add("@PN", SqlDbType.VarChar) SqlConnnection.Open() cmd.Connection = SqlConnnection For i = 0 To RadGridView1.Rows.Count - 1 cmd.Parameters(0).Value = .. 2020. 4. 2.
웹사이트 내용 및 제목 얻는 방법 내용을 얻는 간단한 방법 : WebClient x = new WebClient(); string source = x.DownloadString("http://www.singingeels.com/"); Dim x As WebClient = New WebClient() Dim source As String = x.DownloadString("http://www.singingeels.com/") 제목을 얻는 더 간단하고 안정적인 방법 : string title = Regex.Match(source, @"\]*\>\s*(?[\s\S]*?)\", RegexOptions.IgnoreCase).Groups["Title"].Value;Dim title As String = Regex.Match(source, "\]*\.. 2020. 4. 2.