Share via

XML Java Parser Transform to C# Code

Ingeborg Conrad Oscar 26 Reputation points
2021-12-06T07:03:01.783+00:00

155193-safe.txt

Hello, I have a long code here that i want to transform to C#. Is this possible, because i found no solution online?
Please help me and thanks!

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 83,661 Reputation points
    2021-12-06T16:47:21.23+00:00

    converting java code to C# is pretty simple. But your example code makes heavy use of java libraries. while .net has libraries with similar capabilities, they will not have the same names or methods.

    ado.net is probably the closest database library
    XmlDocument is probably the closest xml library.
    System.Net.Sockets is probably the closest socket library, but you may want to use HttpClient and asp.net core instead.

    0 comments No comments

  2. Lan Huang-MSFT 30,211 Reputation points Microsoft External Staff
    2021-12-06T09:55:44.327+00:00

    Hi @Ingeborg Conrad Oscar ,
    There is a certain gap between the syntax of java and c#.
    You can try to learn C# by yourself, and then rewrite the code.
    You can focus on methods,types etc..
    https://learn.microsoft.com/en-us/dotnet/csharp
    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.