Check whether typed text already exists in a text file on a website

Asked

Viewed 266 times

2

I want the VB to check if the username entered already exists in a text collection 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()

Only instead of searching for txt on my pc, I want it to search on a website. Thanks in advance.

1 answer

2


Maybe this can 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.