给些教程啊,感激ing
官方网站:点击进入
提供多种网站程序:企业站/商城网店/学校/医院/行政/门户/房产/...什么样的都有!
专业网站建设,永久的技术支持,让您无后顾之忧!
联系QQ:812256 183317146 384684725,电话0312-4164045 13613394168
呵呵,应该去请教我们伟大的Google老师。
/*********************
FTP Download and Upload
by netbor
*********************/
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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.IO;
using System.Data.SqlClient;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
public partial class Ftp : System.Web.UI.Page
{
BaseClass bc = new BaseClass();
static string path;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
//打开要下载的文件
string str = this.FileUpload1.PostedFile.FileName;
string ss = str.Substring(str.LastIndexOf("\\"
string s = Server.MapPath("./" + ss);
path = "ftpfiles\\" + ss;
string filepath = GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text.ToString();
string Npath = s + filepath;
System.IO.FileStream r = new System.IO.FileStream(Npath, System.IO.FileMode.Open);
//设置基本信息
Response.Buffer = false;
Response.AddHeader("Connection", "Keep-Alive"
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(System.IO.Path.GetFileName(Npath), Encoding.UTF
会员注册
会员登录
个人空间
发表评论