Verify that typed text already exists in a text file on a site

2

I want VB to verify that the typed username already exists in a text file hosted on a site. I want something like this:

Dim Findstring = IO.File.ReadAllText("C:\Program Files (x86)\EasyPHP-12.1\www\server\users.txt")
Dim Lookfor As String = FlatTextBox1.Text

if Findstring.Contains(Lookfor) Then
   ErroUserExist.ShowDialog()

But instead of looking for txt on my pc, I want it to search on a website. Thank you in advance.

    
asked by anonymous 24.02.2016 / 15:28

1 answer

2

Maybe this might help you:

Imports System.Net
Imports System.Management

Public Class Form1

    Dim Web As New WebClient
    Dim Endereco As String = "http://exemplo.com"
    Dim Server As String = Endereco & "txt/"
    Dim Usuarios As String = Web.DownloadString(Server & "usuarios.txt")

    If Usuarios.Contains(FlatTextBox1.Text) Then
        ErroUserExist.ShowDialog()
    End If
End Class
    
27.02.2016 / 07:43