Код: Выделить всё
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
public partial class view4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strheadlinesid = string.Empty;
if (!IsPostBack)
{
if (!string.IsNullOrEmpty(Convert.ToString(
Request.QueryString["folder"].ToString())))
{
strheadlinesid = Request.QueryString["folder"].ToString();
}
}
Response.Write("");
DirectoryInfo Dir = new DirectoryInfo(strheadlinesid);
FileInfo[] FileList = Dir.GetFiles("*.*", SearchOption.AllDirectories);
foreach (FileInfo FI in FileList)
{
Response.Write("");
Response.Write("[url= view3.aspx?file=] " +
FI.Name + "[/url]");
Response.Write("");
}
Response.Write("");
}
private object DirectoryInfo(string p)
{
throw new NotImplementedException();
}
}
Не удалось найти часть пути
'C:\Users\naresh\Documents\Visual\'.
Фактический путь C:\Users\naresh\Documents\Visual Studio 2010\WebSites\C_Manager\Account. Но часть учетной записи динамически меняется.
Подробнее здесь: https://stackoverflow.com/questions/605 ... in-asp-net
Мобильная версия