Populate a list box from a text file resides in FTP vb.net

suvmitra used Ask the Experts™
Is there a way to populate a list box from a text file resides in my website directory?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
windows forms code link

To do it in ASP.NET with fileupload for text file upload and listbox displaying each line in text file

source; http://stackoverflow.com/questions/1445486/read-from-text-file-into-listbox

Let me know if there is gap in understanding

<asp:FileUpload runat="server" ID="FileUpload1"/>
    <asp:Button ID="btnUpload" runat="server" onclick="btnUpload_Click" Text="Upload" />        
    <asp:ListBox runat="server" ID="ListBox1"></asp:ListBox>

Protected Sub btnUpload_Click(sender As Object, e As EventArgs)
	Using stRead As New StreamReader(FileUpload1.PostedFile.InputStream)
		While Not stRead.EndOfStream
		End While
	End Using
End Sub

Open in new window


I am using VB.NET and creating a windows application. The example you provided is very good. my file say webpages.txt will be in my website. i need that file to read and populated as list box items.

I think for that i need to login into my website through the application providing the login credentials..then find out the webpages.txt and return its all lines and populate the list box.
Yes, you are right.

If you are doing windows application then You need to programmetically login to the site and you will need FTP access to the website - FTP URL & Login credentials.

Here's the links that will help you get started:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial