DirectoryInfo di = newDirectoryInfo(Server.MapPath("/"));
FileInfo[] fi = di.GetFiles();
fi = di.GetFiles("*.*");
foreach (FileInfo fi1 in di.GetFiles())
{
Response.Write( fi1.FullName.ToString());
Response.Write("<br />");
}
DirectoryInfo di = newDirectoryInfo(Server.MapPath("/"));
FileInfo[] fi = di.GetFiles();
fi = di.GetFiles("*.*");
foreach (FileInfo fi1 in di.GetFiles())
{
Response.Write( fi1.FullName.ToString());
Response.Write("<br />");
}
Make 2 forms name it page1.aspx and page2.aspx
on page1.aspx:
Add a TextBox and Button Control
Go to the Button Control Properties and set the PostbackUrl = "~/page2.aspx"
on Page2.aspx:
Add a Label Control and on the Page_Load Event add this following code.
protectedvoidPage_Load(objectsender, EventArgs e)
{
if (PreviousPage != null)
{
if (PreviousPage.IsCrossPagePostBack == true)
{
Label1.Text = "Cross-page post.";
TextBox tb = (TextBox)PreviousPage.FindControl("TextBox1");
this.Title = tb.Text;
}
}
else
{
Label1.Text = "You are not allowed to access this page!";
}
}