아래처럼 소스에 컬러를 입혀준다 ㅎㅎ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | Imports System.Threading 'Made by - 미스터짱 Public Class Form1 Dim PopHb As String Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next WebBrowser1.Navigate(Url.Text & "/bbs/logout.php") Call Loading() WebBrowser1.Navigate(Url.Text & "/bbs/login.php") Call Loading() WebBrowser1.Document.GetElementById("login_id").InnerText = id.Text WebBrowser1.Document.GetElementById("login_pw").InnerText = pw.Text WebBrowser1.Document.GetElementById("flogin").InvokeMember("submit") Call Loading() PopHb = WebBrowser1.Document.Body.InnerHtml If InStr(PopHb, "정보수정") Then Me.Text = ("로그인 성공") id.Enabled = False pw.Enabled = False Url.Enabled = False Button2.Visible = False Else Me.Text = ("로그인 실패") End If End Sub Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed End End Sub Private Sub pw_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles pw.Click If pw.Text = ("PW") Then pw.Text = ("") End If End Sub Private Sub pw_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pw.TextChanged If pw.Text <> ("PW") Then pw.PasswordChar = ("*") End If End Sub Private Sub id_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles id.Click If id.Text = ("ID") Then id.Text = ("") End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click WebBrowser1.Navigate(Url.Text & "/bbs/logout.php") Call Loading() id.Enabled = True pw.Enabled = True Url.Enabled = True Thread.Sleep(100) Button2.Visible = True End Sub Function Loading() Dim i As Integer Do While WebBrowser1.ReadyState <> WebBrowserReadyState.Interactive Application.DoEvents() If i >= 50 Then Exit Do Else i = i + 1 Thread.Sleep(10) End If Loop End Function Private Sub Url_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Url.Click If InStr(Url.Text, "http://홈페이지") Then Url.Text = ("") End If End Sub End Class | cs |
MrZZang