Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 18th, 2013, 6:36 AM   #1
Homie.
Newbie
 
Homie.'s Avatar
 
Join Date: Jan 2013
Posts: 3
Rep Power: 0 Homie. is on a distinguished road
Send a message via Skype™ to Homie.
[help]How to makemy html vote page work in vb.net application

<form action="http://mywebsite.com/Panel/vote_check.php" method="post" id="vote">
Username: <input type="text" name="name" id="name"><br>
<input type="submit" name="submit" value="Vote" id="submit">
</form>

i want to know how to make a application for this html page. i uploaded my html page to my website. now i need to make a application for this form. i tried to do this but i cant im new to vb.net

Imports System.Net
Imports System.Text
Imports System.IO

Public Class Form1
    Dim logincookie As CookieContainer

    Private Sub btvote_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btvote.Click
        Dim postData As String = "http%3A%2F%2Fserver.pwmyth.com%2FPanel%2Fvote_check.php?submit=Vote&name=" + txtuser.Text & ""
        Dim tempcookies As New CookieContainer
        Dim encoding As New UTF8Encoding
        Dim byteData As Byte() = encoding.GetBytes(postData)
        Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://server.pwmyth.com/Panel/vote_check.php"), HttpWebRequest)
        postreq.Method = "POST"
        postreq.KeepAlive = True
        postreq.CookieContainer = tempcookies
        postreq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729"
        postreq.ContentType = "application/x-www-form-urlencoded"
        postreq.Referer = "http://server.pwmyth.com/Panel/vote_check.php"
        postreq.ContentLength = byteData.Length
        Dim postreqstream As Stream = postreq.GetRequestStream()
        postreqstream.Write(byteData, 0, byteData.Length)
        postreqstream.Close()
        Dim postresponse As HttpWebResponse
        postresponse = DirectCast(postreq.GetResponse, HttpWebResponse)
        tempcookies.Add(postresponse.Cookies)
        logincookie = tempcookies
        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
        Dim thepage As String = postreqreader.ReadToEnd
        If thepage.Contains("Copyright (c) 2011 - 2012 Perfect World Myth - Designed by Liostudios") = True Then
            MsgBox("You've already voted within the last 2 hours!", 0, "Vote error!")
        Else
            MsgBox("voted", 0, "Success!")
        End If
    End Sub
End Class

i think this code isnt working

if someone know how to make this please tell me how to do it.
i need to make this with one textbox, one button, maybe webbrower too

Thank you for reading
Homie. is offline   Reply With Quote
Old Jan 18th, 2013, 10:25 AM   #2
Homie.
Newbie
 
Homie.'s Avatar
 
Join Date: Jan 2013
Posts: 3
Rep Power: 0 Homie. is on a distinguished road
Send a message via Skype™ to Homie.
Re: [help]How to makemy html vote page work in vb.net application

no one can help me? :s
Homie. is offline   Reply With Quote
Old Jan 20th, 2013, 2:48 AM   #3
Homie.
Newbie
 
Homie.'s Avatar
 
Join Date: Jan 2013
Posts: 3
Rep Power: 0 Homie. is on a distinguished road
Send a message via Skype™ to Homie.
Re: [help]How to makemy html vote page work in vb.net application

Never mind i fixed it myself
Homie. is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make a html page to open faster? daniel160wong HTML / XHTML / CSS 5 Dec 10th, 2012 8:12 AM
html page updating in real time prad87 HTML / XHTML / CSS 4 Apr 7th, 2010 8:33 PM
start Learning HTMl smita HTML / XHTML / CSS 0 Mar 15th, 2007 7:38 AM
How does a 'router setup page' work? Duck Other Web Development Languages 2 Mar 1st, 2007 10:07 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:03 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC