(02-06-2012, 08:40 AM)AceInfinity Wrote: [ -> ]Learning in itself is good, but if you look at it in a different light, it's probably more productive to learn the most optimized method of code for a particular function, as some methods are better than others. For reasons of performance, speed, safety/exception handling, memory & cpu conservation, etc...
With making a web request, see I would suggest multi-threading as well. Partly for speed, but also to prevent the GUI from locking up.
I heard that multi-threading was bad practice and can make the application buggy, or was it the opposite? I think I'm just going to stick to web development, at least for now. I'll probably do a little more looking into programming before releasing another program.
(02-06-2012, 10:33 AM)BreShiE Wrote: [ -> ]I heard that multi-threading was bad practice and can make the application buggy, or was it the opposite? I think I'm just going to stick to web development, at least for now. I'll probably do a little more looking into programming before releasing another program.
Where did you hear that?
It must have been from someone that uses CheckForIllegalCrossThreading = False, because that's definitely not true. But it is true if you use that boolean value as false. Whoever told you that had no idea what they were talking about though, and obviously doesn't do much research. It only makes the application buggy if you don't know how to use it properly. But almost ALL advanced applications out there use multi-threading. If Web browsers didn't operate on multiple threads you know how much longer you'd have to wait for a page to load?
As I said, it was probably the opposite. I tend not to listen sometimes. xD
(02-08-2012, 09:49 AM)BreShiE Wrote: [ -> ]As I said, it was probably the opposite. I tend not to listen sometimes. xD
Just start remembering that Multi-threading is good. It's a form of parallel programming which definitely improves application performance
not 3 hours, its only one line of code ^_^
Using HttpWebRequest
Code:
Public Function GetSource(Byval URL As String) As String
Dim Request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(URL)
Dim Response As System.Net.HttpWebResponse = Request.GetResponse()
Dim SR As System.IO.StreamReader = New System.IO.StreamReader(Response.GetResponseStream())
Dim Source As String = SR.ReadToEnd()
Return Source
End Function
(08-11-2012, 11:45 PM)Kenneth Wrote: [ -> ]Using HttpWebRequest
Code:
Public Function GetSource(Byval URL As String) As String
Dim Request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(URL)
Dim Response As System.Net.HttpWebResponse = Request.GetResponse()
Dim SR As System.IO.StreamReader = New System.IO.StreamReader(Response.GetResponseStream())
Dim Source As String = SR.ReadToEnd()
Return Source
End Function
-WebClient()
-DownloadString function
html to say thank you: D vooow
Yes, this is a very basic program. (Are you a beginner in programming?)