Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Covvert Code to VB6

Status
Not open for further replies.

Trob70

Programmer
Sep 25, 2012
89
AU
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}",
textBox_BString.Text.Trim());
byte[] data = encoding.GetBytes(postData);

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

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

String strResponse = String.Empty;

HttpWebResponse httpWebResponse =(HttpWebResponse
)myRequest.GetResponse();

if (httpWebResponse.StatusCode == HttpStatusCode.OK)

{

StreamReader streamReader = new StreamReader
(httpWebResponse.GetResponseStream());

strResponse = strResponse + streamReader.ReadToEnd();
TextBox1.Text = strResponse;
streamReader.Close();
}
else
{

Regards Trob70
 
One clue is 'Protected', which suggests that this is VB.NET
 
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


 
Goofiness like [tt](object sender, EventArgs e)[/tt] is another dead giveaway.
 
I am sure you both meant C# rather than VB.Net.
;-)

@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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top