I know you could do thin is VB 6, but i cannot find anything on any webpages for VB.net
I know you could do thin is VB 6, but i cannot find anything on any webpages for VB.net
thats C# :p
But more importantly, it is .Net. Look at it, you can figure out what classes they use to get the source.
OK, I did a quick translation... I don't guarentee the work though, it was from my head.
VB Code:
Public Function DownloadURL(url As String) As String Dim returnString As String Dim req As WebRequest = new WebRequest.Create(url) Dim res As WebResponse = req.GetResponse() Dim totalBuffer As Integer = 0 Dim buffer() As Byte = new Byte(128) Dim stream As Stream = res.GetResponseStream() totalBuffer = stream.Read(buffer,0,128) Dim strRes As StringBuilder = new StringBuilder("") Do While totalBuffer <> 0 strRes.Append(Encoding.ASCII.GetString(buffer,0, totalBuffer)) totalBuffer = stream.Read(buffer, 0, 128) Loop returnString = strRes.ToString() Return returnString End Function
ah much thanks, i gotta play with it a little
In .NET , you shouldn't have any problems switching between .NET Languages since they use the same Framework and CLR . Below my sig. a tool that help you converting From/To VB.NET Code To/From C# Code.Quote:
Originally posted by Azkar
thats C# :p