Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Covvert Code to VB6

Covvert Code to VB6

Covvert Code to VB6

I have a piece of code which i need converted to vb6
Not real sure what it it written in ?????

Really appreciate some help !!!!!!!!!!!!

protected void S_Click(object sender, EventArgs e)

string postData = "AN=1234";
postData += ("&SeC=5678");
postData += string.Format("&BDe={0}",
byte[] data = encoding.GetBytes(postData);

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();

newStream.Write(data, 0, data.Length);

String strResponse = String.Empty;

HttpWebResponse httpWebResponse =(HttpWebResponse

if (httpWebResponse.StatusCode == HttpStatusCode.OK)


StreamReader streamReader = new StreamReader

strResponse = strResponse + streamReader.ReadToEnd();
TextBox1.Text = strResponse;

Regards Trob70

RE: Covvert Code to VB6

One clue is 'Protected', which suggests that this is VB.NET

RE: Covvert Code to VB6

Thanks Strongm

I seem to have it working now in vb6

Was just interested to see what it was written in

Appreciate your response

Regards Trob70

RE: Covvert Code to VB6

Goofiness like (object sender, EventArgs e) is another dead giveaway.

RE: Covvert Code to VB6

I am sure you both meant C# rather than VB.Net.
winky smile

@Trob70: if the type comes first (or: var xyz=...) and there are semicolons at the line end, this always points to a C derivative language like C++, C#, Java or the like.
VB breeds use "Dim xyz As..." and no semicolon.

VB.Net: Dim postData As String = "AN=1234"
C#: string postData="AN=1234";

ôKnowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.ö (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: Covvert Code to VB6

Yeah, yeah, OK ... smile

RE: Covvert Code to VB6

Same aroma, different color.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close