如何在Windows窗体应用程序中上传和下载doc,pdf文件... [英] how to upload and download doc,pdf files in windows form application...
本文介绍了如何在Windows窗体应用程序中上传和下载doc,pdf文件...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮我讲解如何上传/下载doc,pdf文件到SqlServer数据库r2通过
用C#语言编写Windows窗体应用程序。
please help me about how to upload/download doc,pdf files to SqlServer database r2 through
Windows form application in C# language.
推荐答案
试试此链接.. [ ^ ]
上传文件并将其保存在数据库中:
您可以使用以下代码c#
Uploading the file and saving it in your database:
You can use the following code c#
private void pdfuploadBtn_Click(object sender, EventArgs e)
{
OpenFileDialog Openpdf = new OpenFileDialog();
Openpdf.Filter = "PDF files|*.pdf|All files|*.*;";
if (Openpdf.ShowDialog() == DialogResult.OK)
{
string pdfLog = Openpdf.FileName.ToString();
pdfUploadbox.Text = pdfLog;
axAcroPDF1.src = Openpdf.FileName;
//pdfUploadbox.Text = pdfLog;
}
if (axAcroPDF1.src == null)
{
MessageBox.Show("Try new file");
}
else { MessageBox.Show("PDF Uploaded"); }
}
这篇关于如何在Windows窗体应用程序中上传和下载doc,pdf文件...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文