using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
using System.Diagnostics;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["cc2"]);
con.Open();
string str = "select * from productsNews";
SqlCommand cmd = new SqlCommand(str, con);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
string ss = Convert.ToString(reader["Url"]);//
FileInfo yyy=new FileInfo("D://ep1//"+ss);
if (!yyy.Exists)
{
uplink(ss);
}
}
reader.Close();
con.Close();
}
public void uplink(string strl)
{
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["cc2"]);
con.Open();
string str = "delete from productsNews where Url='" + strl + "'";
SqlCommand cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
con.Close();
}
}