1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
protected void LbtnOuvrir_Click(object sender, EventArgs e)
{
string sql = "SELECT FICHIER FROM F_SENTENCE WHERE IDDOSSIER= " + Request.QueryString["ID"];
try
{
Parametres.Connect_Load();
Parametres.Commande.Connection = Parametres.connBD;
Parametres.Commande.CommandText = sql;
Parametres.LectureData = Parametres.Commande.ExecuteReader();
while (Parametres.LectureData.Read())
{
openFilePDFandDOC(@"D:\FileServer\REQUETES_DOSSIERS\" + Parametres.LectureData.GetString(0).ToString());
}
Parametres.LectureData.Close();
Parametres.DeConnect_Load();
}
catch
{
erreur.Visible = true;
erreur.Text = "Impossible d'ouvrir la pièce jointe";
}
}
protected void openFilePDFandDOC(string command)
{
var process = new System.Diagnostics.Process
{
StartInfo = new System.Diagnostics.ProcessStartInfo(command)
};
process.Start();
} |
Partager