ok so i would like to have a key on my program
i thought using httpwrapper to load a file from my site would be best cuz i chould change the key when i want but i dont know how to use httpwrapper fully any help?
Printable View
ok so i would like to have a key on my program
i thought using httpwrapper to load a file from my site would be best cuz i chould change the key when i want but i dont know how to use httpwrapper fully any help?
If you want to download a file from a website, that is pretty easy, just use the WebClient:
Now using that for a key on your program can cause you headaches. What if the user doesn't have an internet connection when they start your app?Code:Dim wc As New System.Net.WebClient
wc.DownloadFile("http://example.com/filename.txt", "C:\Temp\file.txt")
ok that works but now how would i make the code to read the file
if that how it would be?Code:if textbox1.text = (iunno this part) Then
form2.show
me.close
EndIf
Code:textbox1.text = IO.File.ReadAllText("C:\Temp\file.txt")
i get an error is it because my i uploaded it with an FTP thing?
Make sure you put the HTTP:// in front of your URL, also, check the response property of the exception to see why it failed.
not working :l
i tryed http://www.evolutiongaming.co.cc/flp/key1.txt
Try something like this:
Code:Dim wr As System.Net.HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create("http://www.evolutiongaming.co.cc/flp/key1.txt"), System.Net.HttpWebRequest)
wr.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2"
Dim res As System.Net.HttpWebResponse = DirectCast(wr.GetResponse(), System.Net.HttpWebResponse)
Dim read(256) As Char
Dim sr As New IO.StreamReader(res.GetResponseStream())
sr.Read(read, 0, 256)
TextBox1.Text = New String(read, 0, 256)
kay so i think it works i got no errors but how will it open form2
You need to build the code in to do that. So if you want to show form 2 after form 1 based on some condition, you will need to build the if statement and then declare an object as type Form2 and then show it.
i have no how i would do that cuz iunno half the code u just gave me iunno what to do i have thisehh i neve knew this would be that hardvb Code:
if textbox1.text = ?? o.o then form2.show me.close endif
Code:If TextBox1.Text = New String(read, 0, 256) then