해당 소스는 www.juso.co.kr api를 가져온것으로 하였다.

중요한점은 웹브라우저 안에 url 속성값을 줘야한다.(api 주소)


Imports System.Xml

Imports System.Net

Imports System.IO

Imports System.Text.RegularExpressions

Imports System.Text

Public Class Form1


    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

// 웹브라우져 타이틀이 결과 리턴값을 뿌려줄때만 해당함

        If sender.DocumentTitle = "address_ok" Then

            Dim jsonstring As String = Replace(sender.DocumentText, "<title>address_ok</title>", "")

            Dim json_results As New System.Net.Json.JsonTextParser

            Dim j_result As System.Net.Json.JsonObjectCollection


            j_result = json_results.Parse(jsonstring)


            TextBox3.Text = " 신주소 : " & j_result(1).GetValue & " " & j_result(2).GetValue


            WebBrowser1.Dispose()


        End If

    End Sub


End Class

'.net' 카테고리의 다른 글

vb .net json 처리  (0) 2016.08.08
vb net 파일 쓰기 삭제 생성  (0) 2016.06.15
vb .net 웹페이지 xml 데이터 처리  (0) 2016.05.11
vb 웹 페이지 소스 가져오기  (0) 2016.05.10
vb net 스프레드 크기 조정  (0) 2016.04.18
Posted by 몽키 D.루피
,
vb웹페이지 내용 그대로 읽어오기 소스

Imports System.Net
Imports System.IO
Imports System.Text.RegularExpressions
 
Public Class Form1
 
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text.Length < 10 Then
            MsgBox("가져올 페이지의 URL을 입력하세요!")
            Return
        End If
 
        Try
            Dim wresp As WebResponse
            Dim wreq As WebRequest = HttpWebRequest.Create(TextBox1.Text)
            Dim str As String = ""
            wresp = wreq.GetResponse()
 
            Using sr As New StreamReader(wresp.GetResponseStream())
                str = sr.ReadToEnd()
                sr.Close()
            End Using
 
            Dim sta As Integer
 
            sta = InStr(str, "<body")
            If sta = 0 Then sta = InStr(str, "<BODY")
            If sta = 0 Then sta = 1 'not found <body or <BODY
 
            str = Regex.Replace(Mid(str, sta), "<.*?>", "")
            TextBox2.Text = str
        Catch ex As Exception
            MsgBox(ex.Message, "가져오기 실패")
        End Try
    End Sub
End Class

http://yaraba.tistory.com/412 페이지에서 참조


Posted by 몽키 D.루피
,

//실시간 검색

Private Sub FpS123_EditModeOn(sender As Object, e As EventArgs) Handles FpS123.EditModeOn


        Dim KeyPressHandler As KeyEventHandler = AddressOf FpS123_KeyUp

        AddHandler FpS123.EditingControl.KeyUp, KeyPressHandler



        With FpS123.ActiveSheet

            FpS123.Sheets(0).SetText(0, 1, .GetText(.ActiveRowIndex, .ActiveColumnIndex))

            'MessageBox.Show(.GetText(.ActiveRowIndex, .ActiveColumnIndex))

            ' Call test(.GetText(.ActiveRowIndex, .ActiveColumnIndex))

        End With


    End Sub


    Private Sub FpS123_EditModeOff(sender As Object, e As EventArgs) Handles FpS123.EditModeOff


        Dim edit_text


        Dim KeyPressHandler As KeyEventHandler = AddressOf FpS123_KeyUp

        RemoveHandler FpS123.EditingControl.KeyUp, KeyPressHandler

        edit_text = Split(sender.AccessibleDescription, ",")




        With FpS123.ActiveSheet


            FpS123.Sheets(0).SetText(0, 1, .GetText(.ActiveRowIndex, .ActiveColumnIndex))

            'MessageBox.Show(.GetText(.ActiveRowIndex, .ActiveColumnIndex))

            ' Call test(.GetText(.ActiveRowIndex, .ActiveColumnIndex))

        End With


    End Sub




    Private Sub FpS123_KeyUp(sender As Object, e As KeyEventArgs) Handles FpS123.KeyUp, FpS123.KeyDown


        If sender.ToString = "FarPoint.Win.Spread.CellType.GeneralEditor" Then


            'FarPoint.Win.Spread.CellType.GeneralEditor

            If e.KeyCode = Keys.Escape Then Exit Sub

            If e.KeyCode = Keys.Enter Then Exit Sub


            If e.KeyCode = Keys.Delete Then

                With FpS123.ActiveSheet

                    Select Case MsgBox("선택된 부분을 삭제하시겠습니까?", MsgBoxStyle.YesNo, "caption")

                        Case MsgBoxResult.Yes

                            ' MessageBox.Show("Yes button")

                            FpS123.Sheets(0).Rows.Remove(.ActiveRowIndex, 1)

                            sang_sprR = sang_sprR - 1

                        Case MsgBoxResult.No

                            'MessageBox.Show("NO button")

                    End Select

                End With

                Exit Sub

            End If


            Dim test_text As String

            test_text = sender.FormatText


            FpS123.Sheets(0).SetText(0, 2, test_text)


        End If


    End Sub

'.net' 카테고리의 다른 글

vb 웹 페이지 소스 가져오기  (0) 2016.05.10
vb net 스프레드 크기 조정  (0) 2016.04.18
vb .net 스프레드 시트에서 해당위치 텍스트 가져오기  (0) 2016.03.31
vb .net confirm 박스  (0) 2016.03.31
mysql dll 참조추가시  (0) 2016.03.31
Posted by 몽키 D.루피
,

vb .net confirm 박스

.net 2016. 3. 31. 15:13

Case MsgBoxResult.Yes
                        ' MessageBox.Show("Yes button")
                        FpS진료실상병.Sheets(0).Rows.Remove(set_cell, 1)
                        sang_sprR = sang_sprR - 1
                    Case MsgBoxResult.Cancel
                        'MessageBox.Show("Cancel button")
                    Case MsgBoxResult.No
                        'MessageBox.Show("NO button")

Posted by 몽키 D.루피
,

 With FpSlist.ActiveSheet
            set_cell = ""
            set_cell = .ActiveRowIndex    '해당 로우 인덱스 위치

'Keys.키보드버튼

            If e.KeyCode = Keys.Delete Then
                FpSlist.Sheets(0).Rows.Remove(set_cell, 1)
                sang_sprR = sang_sprR - 1
            End If

        End With

 

한줄 삭제 방법

'.net' 카테고리의 다른 글

vb net 스프레드 크기 조정  (0) 2016.04.18
vb net 스프레드 시트 keyup  (0) 2016.04.07
vb .net 스프레드 시트에서 해당위치 텍스트 가져오기  (0) 2016.03.31
vb .net confirm 박스  (0) 2016.03.31
mysql dll 참조추가시  (0) 2016.03.31
Posted by 몽키 D.루피
,