View the server disk, ASPX for the file.
Last Update:2017-02-28
Source: Internet
Author: User
Listdrives.aspx
<% @Page language= "C #"%>
<% @Import namespace= "System"%>
<% @Import namespace= "System.IO"%>
<%
String qdrives = Environment.OSVersion.ToString ();
String qnewline=environment.systemdirectory.tostring ();
String qmo=environment.workingset.tostring ();
int qtick=environment.tickcount;
qtick/=60000;
string[] achdrives = directory.getlogicaldrives ();
int nnumofdrives = Achdrives.length;
Response.Write ("Your system is:");
Response.Write (qdrives);
Response.Write ("<br>");
Response.Write ("Your Available memory is:");
Response.Write (QMO);
Response.Write ("<br>");
Response.Write ("Since the last reboot has been");
Response.Write (Qtick. ToString ());
Response.Write ("Minutes");
Response.Write ("<br>");
Response.Write ("<br>");
Response.Write ("<br>");
Response.Write ("View your disk:");
Response.Write ("<ul>");
for (int i=0 i < nnumofdrives; i++)
{
Response.Write ("<li><a href=\" listdir.aspx?dir=);
Response.Write (Server.URLEncode (achdrives[i));
Response.Write (">" + achdrives[i]);
Response.Write ("</a><br>");
}
Response.Write ("</ul>");
%>
Listdir.aspx
<% @Page language= "C #" debug= "true"%>
<% @Import namespace= "System.IO"%>
<%
String strdir2list = Request.QueryString.Get ("dir");
Directory thisone = null;
Try
{
Thisone = new Directory (strdir2list);
Auslesen der Eigenschaften der Verzeichnisses
Response.Write ("<p> creation Time:" + thisOne.CreationTime.ToString () + "</p>");
directory[] subdirectories = Thisone.getdirectories ();
Response.Write ("<ul>");
Response.Write ("-------------------------------folder-------------------------");
Response.Write ("<br>");
for (int i=0 i < subdirectories.length; i++)
{
Response.Write ("<li><a href=\" listdir.aspx?dir=);
Response.Write (Server.URLEncode (subdirectories[i). FullName));
Response.Write ("\" > "+ subdirectories[i]." Name);
Response.Write ("</a><br>");
}
Response.Write ("</ul>");
file[] Thefiles = Thisone.getfiles ();
Response.Write ("<ul>");
Response.Write ("-------------------------------document----------------------------");
Response.Write ("<br>");
for (int i=0 i < thefiles.length; i++)
{
Response.Write ("<li><a href=\" showfile.aspx?file=);
Response.Write (Server.URLEncode (thefiles[i). FullName));
Response.Write ("\" > "+ thefiles[i]." Name);
Response.Write ("</a><br>");
}
Response.Write ("</ul>");
}
catch (Exception e)
{
Response.Write ("This feature cannot be implemented for the following reasons:");
Response.Write (e.tostring () + "");
Response.End ();
}
%>
Showfile.aspx
<% @Page language= "C #" debug= "true"%>
<% @Import namespace= "System.IO"%>
<body>
<%
String strfile2show = Request.QueryString.Get ("file");
File Thisone = new file (strfile2show);
%>
<table>
<tr><td> filename:</td><td><%=thisone.name%></td></tr>
<tr><td> Full Name:</td><td><%=thisone.fullname%></td></tr>
<tr><td> File Creation Date: </td><td><%=thisone.creationtime.tostring ()%></td></tr >
<tr><td> File Size: </td><td><%=thisone.length.tostring ()%> bytes</td></tr>
<tr><td> last used time: </td><td><%=thisone.lastaccesstime.tostring ()%></td></tr >
<tr><td> Last modified: </td><td><%=thisone.lastwritetime.tostring ()%></td></tr >
</table>
<%
StreamReader Thereader = Thisone.opentext ();
char[] Thebuffer = new char[1000];
int nread = Thereader.readblock (thebuffer, 0, 1000);
Response.Write ("<br>");
Response.Write ("File content preview:");
Response.Write ("<br>");
Response.Write ("<pre>");
Response.Write (Server.HTMLEncode) (New String (Thebuffer,0,nread));
Response.Write ("</pre>");
%>
</body>
is enriching into management, integration upload, modify, delete and other management functions
I don't know if I've got that much time.
Work hard, my friend.
Turn from: Dynamic Network production guide www.knowsky.com