将Java转换为C# [英] Converting Java to C#

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

问题描述

我已从互联网上下载了一些Java文件,并希望将它们用作C#程序的

基础。


它们是.jar文件,当我在记事本中打开它们时,它们不是文本

文件。


有没有办法从中获取某种源代码他们?


对不起,如果这听起来有点基础,但我以前从未使用过Java。

I''ve downloaded some Java files from the internet, and want to use them as a
basis for a C# programme.

They are .jar files, and when I open them in Notepad, they are not text
files.

Is there a way to get some sort of source code from them?

Sorry if this sounds a bit basic, but I''ve never used Java before.

推荐答案

你好Jay,


这几乎不是java问题的新闻组。


JAR文件是Java ARchive文件可以使用JAVA SDK jar工具或WinRar或类似工具解压缩(可能与WinZip不兼容)


-

快乐编码!

Morten Wennevik [C#MVP]
Hi Jay,

This is hardly a newsgroup for java questions.

JAR files are Java ARchive files that can be decompressed using the JAVA SDK jar tool or WinRar or similar (may not work well with WinZip)

--
Happy coding!
Morten Wennevik [C# MVP]


<" Jay" < - >写道:
<"Jay" <->wrote:

我已从互联网上下载了一些Java文件,并希望将它们用作

一个C#程序的基础。


它们是.jar文件,当我在记事本中打开它们时,它们不是文本

文件。


有没有办法从它们那里获取某些源代码?


对不起,如果这听起来有点基础,但我从来没用过Java之前。
I''ve downloaded some Java files from the internet, and want to use them as a
basis for a C# programme.

They are .jar files, and when I open them in Notepad, they are not text
files.

Is there a way to get some sort of source code from them?

Sorry if this sounds a bit basic, but I''ve never used Java before.



好​​吧,你可以反编译它们 - 但是如果没有

的许可这样做,作者有点不道德并且很可能是非法的

许可证。


基本上,将jar文件视为.NET程序集的粗略等价物。

(它''不是那么简单,但基本上它们包含编译的

类,而不是源文件。)


-

Jon Skeet - < sk *** @ pobox.com>
http:/ /www.pobox.com/~skeet 博客: http:// www .msmvps.com / jon.skeet

如果回复小组,请不要给我发邮件

Well, you could decompile them - but to do so without the permission of
the author is somewhat unethical and could well be illegal depending on
the licence.

Basically, think of jar files as rough equivalents of .NET assemblies.
(It''s not that straightforward, but basically they contain the compiled
classes, rather than being source files.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


" Jay" ; < -wrote:
"Jay" <-wrote:

它们是.jar文件,当我在记事本中打开它们时,

它们不是文本文件。
They are .jar files, and when I open them in Notepad,
they are not text files.



Jar文件是二进制文件,大致相当于.NET的exe文件。他们

不是源代码。

Jar files are binaries, broadly equivalent to .NET''s exe files. They
aren''t source code.


有没有办法从他们那里获得某种源代码?
Is there a way to get some sort of source code from them?



没有反汇编,它不会给你有用的位,比如

变量名,不。我认为Java中的源代码文件通常需要一个

..java扩展名。


Eq。

Short of disassembly, which won''t give you the useful bits like
variable names, no. I think source code files in Java usually take a
..java extension.

Eq.


这篇关于将Java转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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