阅读Dropbox txt文件

时间:2014-01-11 17:56:10

标签: vb.net dropbox

我正在努力建立一个注册并拥有此代码

 Dim webs As New Net.WebClient
 Dim reader As StreamReader = New StreamReader(client.OpenRead(https://www.dropbox.com/s/wvobcpniczdx1s0/regList.txt)

Private Sub cmdRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRegister.Click
    If TextBox1.Text + TextBox2.Text + TextBox3.Text + TextBox4.Text = reader.ReadToEnd Then
        MsgBox("You have Registered Succesfully")
    Else
        MsgBox("You Failed To register")
    End If
End Sub

我想要做的是让它读取dropbox .txt文件,然后说,如果4个文本框都添加到dropbox txtfile,那么它将成功注册

在Dropbox中,注册密钥为“aaaaabbbbbcccccddddd” 当我把它放在4个方框中的5位数时,表示失败(n)

如果我把所有4个盒子加起来就是唯一可行的方法=“aaaaabbbbbcccccddddd”

2 个答案:

答案 0 :(得分:0)

您无法像这样阅读Dropbox文本。我发现,如果这是一个不合适的参数,dropbox会给出原始文件。只需使用网址并添加如下内容:

https://dl.dropboxusercontent.com/s/wvobcpniczdx1s0/regList.txt?insert_anything_you_want

但要注意

答案 1 :(得分:0)

要从位于Dropbox服务器的文件中获取计划文本,我们有以下链接

https://dl.dropboxusercontent.com/s/wvobcpniczdx1s0/regList.txt?dl=0

现在我们需要阅读链接中的文字..

Dim address As String = "https://dl.dropboxusercontent.com/s/82wlkg6l4idkewk/KPRAVEENSTOCKS.txt?dl=0"
        Dim client As WebClient = New WebClient()
        Dim reader As StreamReader = New StreamReader(client.OpenRead(address))
        MsgBox(reader.ReadToEnd)

完整代码:

    Private Sub cmdRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRegister.Click

Dim address As String = "https://dl.dropboxusercontent.com/s/82wlkg6l4idkewk/KPRAVEENSTOCKS.txt?dl=0"
            Dim client As WebClient = New WebClient()
            Dim reader As StreamReader = New StreamReader(client.OpenRead(address))


        If TextBox1.Text + TextBox2.Text + TextBox3.Text + TextBox4.Text = reader.ReadToEnd Then
            MsgBox("You have Registered Succesfully")
        Else
            MsgBox("You Failed To register")
        End If
    End Sub