473,396 Members | 2,081 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,396 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 22 '05 #1
1 9873
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:eJ**************@TK2MSFTNGP11.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 22 '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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.