The problem with the developerfusion conversion is that it isn't C# code.
The most obvious problem is that there is no implicit assignment to the
method name in C# like there is in VB.
Our Instant C# VB.NET to C# converter produces:
public object getXML(string sourceFile)
{
object tempgetXML = null;
System.Net.WebRequest myRequest =
System.Net.WebRequest.Create(sourceFile);
System.Net.WebResponse myResponse = myRequest.GetResponse();
System.Xml.XmlTextReader myReader = new
System.Xml.XmlTextReader(myResponse.GetResponseStr eam());
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(myReader);
tempgetXML = doc;
myResponse.Close();
myReader.Close();
return tempgetXML;
}
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
"Wajahat Abbas" wrote:
Cool ...
Well it would be really difficult for one to answer "How to convert Vb.Net
code into Vb.Net" ? :)
Anyway you can find an utility which do it all.
Check it out here.
http://wajahatabbas.blogspot.com/200...converter.html
--
Wajahat Abbas
http://www.wajahatabbas.com
"Anand[MVP]" wrote:
Looks like it is already in VB.NET...:-)
--
Rgds,
Anand
VB.NET MVP
http://www.dotnetindia.com
"Patrick.O.Ige" wrote:
Can someone help me convert the code below to VB.NET.
Thanks
Function getXML(ByVal sourceFile As String)
Dim myRequest As System.Net.WebRequest =
System.Net.WebRequest.Create(sourceFile)
Dim myResponse As System.Net.WebResponse = myRequest.GetResponse()
Dim myReader As System.Xml.XmlTextReader = New
System.Xml.XmlTextReader(myResponse.GetResponseStr eam())
Dim doc As System.Xml.XmlDocument = New System.Xml.XmlDocument
doc.Load(myReader)
getXML = doc
myResponse.Close()
myReader.Close()
End Function