Visual Basic Dropbox txt file help

Status
Not open for further replies.

Vipervgts

Honorable
Oct 12, 2012
12
0
10,560
0
I'm trying to make a program that has a textbox and a button and make it so that when you press the button, it looks into a text file on dropbox, and reads it and if the textbox has the text that the text file has, make it trigger something. If somebody could please help me, I would really appreciate it. Thank you!
 

dmroeder

Distinguished
Jan 15, 2005
42
0
18,590
3
I'm a little late to this party. I use the following code to do exactly what you are after. The file I'm reading is in my dropbox public directory.

Dim myWebClient As New System.Net.WebClient 'the webclient
Dim file As New System.IO.StreamReader(myWebClient.OpenRead("DropboxFilePathGoesHere"))
textbox1.text = file.ReadToEnd()
file.Close()
Obviously in this example there is no error trapping so you will want make sure it doesn't crash in the event it does not find the file.
 
Dec 7, 2013
1
0
10,510
0
Thats actualy prety easy.

#first you define a new variable called "webs" for a new webclient


Dim webs as new net.webclient
dim passwordfile as string = "File link here make sure its in a public folder!"

try
if textbox1.text = webs.downloadstring(passwordfile) then
messagebox.show("Password right!"
else
messagebox.show("Wrong password")

Catch as an Exception

messagebox.show("Couldn't connect to the interet or the file doesn't exist anymore!")

end try



This is working i hope i helped you :)
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
M Apps General Discussion 1
E Apps General Discussion 1
Rainfire Apps General Discussion 3
R Apps General Discussion 1
RAZER Gamer Apps General Discussion 2
Cathroad Apps General Discussion 1
RAZER Gamer Apps General Discussion 3
M Apps General Discussion 1
K Apps General Discussion 2
I Apps General Discussion 6
MrAlaweey98 Apps General Discussion 1
M Apps General Discussion 5
S Apps General Discussion 3
A Apps General Discussion 1
T Apps General Discussion 2
V Apps General Discussion 1
G Apps General Discussion 3
G Apps General Discussion 3
N Apps General Discussion 1
2 Apps General Discussion 1

ASK THE COMMUNITY