gibson
May 1st, 2006, 02:14 PM
Hey. I tried to make this with visual c++ but i stopped with it. So i give it a shot with visual basic.net. Well i have a form for posting data to a webserver. I inserted a webbrowser in my form. And i can open the requested page.
But now the problem is i can't post data. I don't understand the vheader thing.
My visual basic project must have the same result as the following .js file:
Remark: The .js file is just an example for the ouput. It has nothing to do with my vb file. I just want the same result.
document.write('<form enctype="multipart/form-data" action="http://www.vbulletin.be/newthread.php" method="POST" name="postformke" target="_blank">');
document.write('<input type="hidden" name="s" value="">');
document.write('<input type="hidden" name="f" value="">');
document.write('<input type="hidden" name="do" value="postthread">');
document.write('<input type="hidden" name="subject" value="">');
document.write('<input type="hidden" name="message" value="">');
document.write('</form><td align="left"><input type="button" value="ehb-smi" onClick="doformke()"></td>');
function doformke() {
document.postformke.subject.value=document.standaard.subject.value;
document.postformke.message.value=document.standaard.message.value;
Code i actualy have:
Private Sub cmdSubmit_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cmdSubmit.Click
Dim vPost As Object
Dim vHeaders As Object
Dim cFlavor As String
Dim cParamFlavor As String
Dim cParamName As String
Dim cPostData As String
Dim cSeparator As String
cFlavor = cboFlavor.SelectedItem
cParamFlavor = "Flavor="
cSeparator = "&"
cParamName = "FName="
cPostData = subject.Text
vHeaders = "Content-Type: application/x-www-form-urlencoded" + Chr(10) + Chr(13)
vPost = ASCIIEncoding.ASCII.GetBytes(cPostData)
AxWebBrowser1.Navigate2("http://www.vbulletin.be/newthread.php?f=28", Nothing, Nothing, vPost, vHeaders)
End Sub
Greetz
gibson
But now the problem is i can't post data. I don't understand the vheader thing.
My visual basic project must have the same result as the following .js file:
Remark: The .js file is just an example for the ouput. It has nothing to do with my vb file. I just want the same result.
document.write('<form enctype="multipart/form-data" action="http://www.vbulletin.be/newthread.php" method="POST" name="postformke" target="_blank">');
document.write('<input type="hidden" name="s" value="">');
document.write('<input type="hidden" name="f" value="">');
document.write('<input type="hidden" name="do" value="postthread">');
document.write('<input type="hidden" name="subject" value="">');
document.write('<input type="hidden" name="message" value="">');
document.write('</form><td align="left"><input type="button" value="ehb-smi" onClick="doformke()"></td>');
function doformke() {
document.postformke.subject.value=document.standaard.subject.value;
document.postformke.message.value=document.standaard.message.value;
Code i actualy have:
Private Sub cmdSubmit_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cmdSubmit.Click
Dim vPost As Object
Dim vHeaders As Object
Dim cFlavor As String
Dim cParamFlavor As String
Dim cParamName As String
Dim cPostData As String
Dim cSeparator As String
cFlavor = cboFlavor.SelectedItem
cParamFlavor = "Flavor="
cSeparator = "&"
cParamName = "FName="
cPostData = subject.Text
vHeaders = "Content-Type: application/x-www-form-urlencoded" + Chr(10) + Chr(13)
vPost = ASCIIEncoding.ASCII.GetBytes(cPostData)
AxWebBrowser1.Navigate2("http://www.vbulletin.be/newthread.php?f=28", Nothing, Nothing, vPost, vHeaders)
End Sub
Greetz
gibson