Torna al Thread

Imports System.IO Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim path As String = "d:\contatti.txt" Try Dim sr As StreamReader = File.OpenText(path) Do While sr.Peek() >= 0 Dim line As String = sr.ReadLine() If line.Contains("@") Then ListBox1.Items.Add(line.Replace("Email Address: ", "")) End If Loop sr.Close() Catch ex As Exception Console.WriteLine("The process failed: {0}", ex.ToString()) End Try End Sub End Class
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5