A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.
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.