ขอต้อน รับ เข้า สู่ เว็ป ไซต์ ขาย โปรเเกรม VB Project 2008 hack zone game ต่างๆ ได้เเละ มี คลิบ สำหรับ BASIC มือสมัครเล่น
Photobucket Photobucket Photobucket
+[หมวดหมู่]+

*********************************************************************************************************************************************************************************************************

สอน Project เปลี่ยนพาสเวิร์ดประจำวัน Hosting Computer VB.NET




CODE


Imports System.IO
Imports System.Net
Imports System.Management
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim request As HttpWebRequest = DirectCast(WebRequest.Create("http://127.0.0.1/ID.txt"), HttpWebRequest)
            Dim response As HttpWebResponse = DirectCast(request.GetResponse, HttpWebResponse)
            Dim str As String = New StreamReader(response.GetResponseStream).ReadToEnd
            If TextBox1.Text = "" Then
                MsgBox("รหัสไม่ถูกต้อง", MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "")
            Else
                Select Case checkLogin(TextBox1.Text, TextBox1.Text)
                    Case True
                        MsgBox("รหัสถูกต้อง", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "")
                        Form2.Show()
                        Me.Hide()
                    Case False
                        MsgBox("รหัสไม่ถูกต้อง", MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "")
                End Select
            End If
        Catch Exception1 As Exception
            Dim exception As Exception = Exception1
            MsgBox("", MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Error")
        End Try
    End Sub
    Private Function checkLogin(ByVal sUser As String, ByVal sPass As String) As Boolean
        Dim login As String()
        Dim wr As HttpWebRequest = HttpWebRequest.Create("http://127.0.0.1/ID.txt")
        Dim response As HttpWebResponse = wr.GetResponse()
        Dim sr As StreamReader = New StreamReader(response.GetResponseStream())
        While Not sr.EndOfStream
            login = sr.ReadLine.Split("/")
            If sUser = login(1) Then

                Return True


            End If
        End While
        Return False

    End Function
End Class

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

จำนวนการดูหน้าเว็บรวม