C#中Java代码的替代方法 [英] alternative of java code in C#

查看:115
本文介绍了C#中Java代码的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以在c#中给我这种代码的替代方法.我曾经使用服务器到服务器进行通信,但是在belove代码中出现了错误.我无法将以下Java代码转换为c#

Anybody give me alternative of this code in c#. I used to server to server communication but got error in belove code. I unable to convert the below Java code to c#

java.net.HttpURLConnection httpurlconnection = null;
httpurlconnection.setDoOutput(true);



问候
Ravi



Regards
Ravi

推荐答案

尝试以下链接,看看它们是否对您有帮助


http://www.velocityreviews.com/forums/t88991-url-class-in- c.html [ ^ ]

http://ondotnet.com/pub/a/dotnet/2001/07/17/csharp3.html?page = 2 [ ^ ]

祝您好运:)
Try the following links and see if they help you


http://www.velocityreviews.com/forums/t88991-url-class-in-c.html[^]

http://ondotnet.com/pub/a/dotnet/2001/07/17/csharp3.html?page=2[^]

Good luck :)


该代码无论如何将在第二行中抛出Java中的NullReferenceException.

从下面的注释中,您似乎要使用WebRequest/HttpWebRequest.看看此MSDN页面 [
That code will throw a NullReferenceException in Java on the second line anyway.

from your comment below it looks like you want to use WebRequest/HttpWebRequest. Have a look at this MSDN page[^] which should help you.


代码您在第二行中提到的将引发异常.
The code which you have mentioned in the Second line will throws an Exception.


这篇关于C#中Java代码的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆