473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Java to c# conversion

K R


Hi,

Please let me know the equivalent code to the below code in c#
(ASP.NET).

This below code is written in java.

MyDataString =
#DREDOCID 1
#DREFIELDNAME Price
#DREFIELDVALUE 10
#DREDOCREF http://www.autonomy.com/autonomy/dyn...opage442.shtml
#DREFIELDNAME Country
#DREFIELDVALUE UK

SAMPLE CODE

URL suir_url = new URL("http://" +SUIRServer +":" +SUIRPort
+"/DREREPLACE?");
URLConnection suir_connection = suir_url.openConnection();
suir_connection.setDoOutput(true);
PrintWriter suir_out = new
PrintWriter(suir_connection.getOutputStream());
suir_out.println(MyDataString +"#DREENDDATA" +"\n\n"); // PASS data
as POST To Suir
suir_out.close();
Regards.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 1694
It should be something like:

[ using System, System.IO, System.Net ]
Uri suir_url = new Uri("http://" +SUIRServer +":" +SUIRPort
+"/DREREPLACE?");
HttpWebRequest wr = HttpWebRequest.Create(url);
wr.Method = "POST";
// wr.ContentType = "application/x-www-form-urlencoded";
StreamWriter sw = new StreamWriter(wr.GetRequestStream());
sw.Write(data);
sw.Close();
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"K R" <kr*********@gmail.com> wrote in message
news:up**************@TK2MSFTNGP15.phx.gbl...


Hi,

Please let me know the equivalent code to the below code in c#
(ASP.NET).

This below code is written in java.

MyDataString =
#DREDOCID 1
#DREFIELDNAME Price
#DREFIELDVALUE 10
#DREDOCREF http://www.autonomy.com/autonomy/dyn...opage442.shtml
#DREFIELDNAME Country
#DREFIELDVALUE UK

SAMPLE CODE

URL suir_url = new URL("http://" +SUIRServer +":" +SUIRPort
+"/DREREPLACE?");
URLConnection suir_connection = suir_url.openConnection();
suir_connection.setDoOutput(true);
PrintWriter suir_out = new
PrintWriter(suir_connection.getOutputStream());
suir_out.println(MyDataString +"#DREENDDATA" +"\n\n"); // PASS data
as POST To Suir
suir_out.close();
Regards.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Roy Schestowitz | last post by:
Hi, I have asked this question in a C++ newsgroup, but I did not get quite the answer that I had hoped for. I would like to find out if there are tools which make large transitions from C++ to...
0
by: Charles Atwood | last post by:
I am trying to use the Java Language Conversion Assistant 2.0 with Visual Studio .NET 2003 on Windows 2000 Server SP4 and .NET framework 1.1 to convert some java files to C#. I go through all the...
7
by: jeff | last post by:
We have a library written in Java that we need to port to .NET (and we need to maintain both versions of the library). I've done some preliminary research on approaches to this but none of them...
2
by: Barney | last post by:
I have to convert a Java app to .NET, i found and used the conversion tool which converts java to C#, but it only converted about 10% of it, how hard would it be to re-write the java app and keep...
5
by: Michael Murphy | last post by:
Hi, could someone help me along with a Java to VB.Net conversion. Here is the java code private sub test1() throws Exception { //code in here }
1
by: Jimmy Zhang | last post by:
Hi, I was using JLCA to convert some code to C# and app performance just dropped a bit, I am wondering if any one can point me to some good reference on C# performance tuning tricks... Cheers, jz
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
by: vadala | last post by:
The requirement is to send start data and end date from java to UI (.net) for a functionality. We are setting the time in java (1.5) before handing it over to WebService (sending to UI ) in...
9
by: =?Utf-8?B?RmxhdmVsbGUgQmFsbGVt?= | last post by:
Apparently the Java Conversion tool that used to be in Visual Studio 2005 is no longer supported in Visual Studio 2008. Anyone have any suggestions on how to convert a Java program to C# in Visual...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.