C# Web sitelerinde e -mail cekme programı

Posted: July 10, 2014 in C#
Tags: ,

Asagıdaki program sitelerdeki e-mail adreslerini bulmaktadır.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Net;
using System.IO;

namespace WindowsFormsApplication23
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

textBox2.Text = “Baglantı kurulmaya çalışılıyorr”;
WebResponse response = null;
try
{
WebRequest WebReq = WebRequest.Create(textBox1.Text);
response = WebReq.GetResponse();
textBox2.Text = “Baglantı kuruldu”;
Stream ad = response.GetResponseStream();
StreamReader reader = new StreamReader(ad);
string site = reader.ReadToEnd();

Regex mailler = new Regex
(“[\\w-]+(?:\\.[\\w-]+)*@(?:[\\w-]+\\.)+[a-zA-Z]{2,7}”);
listBox1.Items.Clear();
foreach (Match yaz in mailler.Matches(site))
{
listBox1.Items.Add(yaz.Value);
}
textBox2.Text = “Bulunanlar listelendi”;
}
catch
{
textBox2.Text = “Baglantı hatası”;

}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}
}
}

rege

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s