12/24/21

Kirim POST ke Server Menggunakan VB.Net Script VB

                    Dim reg As String

                    reg = "https://localhot/test.php"

                    Dim _req As HttpWebRequest = HttpWebRequest.Create(reg)

                    _req.Method = "POST"

                    _post = "pass=inun20211"

                    Dim _postByte As Byte() = Encoding.UTF8.GetBytes(_post)

                    _req.ContentType = "application/x-www-form-urlencoded"

                    _req.ContentLength = _postByte.Length

                    Dim _postStream As Stream = _req.GetRequestStream()

                    _postStream.Write(_postByte, 0, _postByte.Length)

                    _postStream.Close()

                    Dim response As WebResponse = _req.GetResponse()

                    _postStream = response.GetResponseStream()

                    Dim reader As New StreamReader(_postStream)

                    Dim _resServer As String = reader.ReadToEnd()

                    Dim t() As String = Split(_resServer, ";")

                    If t(0) = "GAGAL" Then

                        'MsgBox(t(0))

                        MsgBox(" GAGAL " & vbNewLine & t(1))

                        Me.Close()

                    End If


Postingan Lebih Baru Postingan Lama