⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx

📁 这个源代码是我在没有参考任何现成的代码的情况下一个字母一个字母敲进去的.目前实现了创建文件,读写文件的操作,暂时不支持子目录、长文件名、文件删除、重命名等操作。
💻 ASPX
字号:
<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="false" Inherits="FTP.MainFileSystemViewer" %>
<HTML>
	<HEAD>
		<title>FTP</title>
		<META http-equiv="Expires" content="0">
		<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
		<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<meta http-equiv="Pragma" content="no-cache">
		<LINK href="styles.css" type="text/css" rel="stylesheet">
		<script language="javascript">
			function confirmDelete(filePath, fileName){
				if(confirm("Really delete? '" + fileName + "'"))
	   	 			document.location = filePath;
			}
		</script>
	</HEAD>
	<body>
		<form id="Form1" method="post" encType="multipart/form-data" runat="server">
			<asp:label id="Header" style="TEXT-ALIGN: center" runat="server" Height="20px" ForeColor="Navy" Width="100%" BackColor="#C0C0FF"></asp:label><asp:imagebutton id="UpBtn" runat="server" ToolTip="Up one level" ImageUrl="pics/hup_one_level.gif" CommandName="ChangePath" CommandArgument="../"></asp:imagebutton><asp:imagebutton id="GoRoot" runat="server" ImageUrl="pics/home_icon.gif" CommandName="ChangePath" CommandArgument="/" AlternateText="Back to Root Directory"></asp:imagebutton>
			<TABLE cellSpacing="0" cellPadding="1" width="100%" border="0">
				<tr>
					<TH width="30" bgColor="#000000">
						<FONT color="#ffffff">&nbsp;</FONT></TH>
					<TH align="left" width="450" bgColor="#000000">
						<FONT color="#ffffff" size="2">Name</FONT></TH>
					<TH width="80" bgColor="#000000">
						<P align="left"><FONT color="#ffffff" size="2">Size</FONT></P>
					</TH>
					<TH width="200" bgColor="#000000">
						<P align="left"><FONT color="#ffffff" size="2">Last Modified</FONT></P>
					</TH>
					<TH width="50" bgColor="#000000">
						<P align="left"><FONT color="#ffffff" size="2">Del</FONT></P>
					</TH>
				</tr>
				<asp:placeholder id="FilesFolders" runat="server"></asp:placeholder></TABLE>
			<P></P>
			<P align="center">
				<TABLE id="Table1" borderColor="#ccccff" cellSpacing="0" cellPadding="7" bgColor="#6699ff" border="1">
					<TR>
						<TD bgColor="background"><STRONG><FONT color="#ffffff">Upload a file</FONT></STRONG></TD>
						<TD bgColor="highlight"><STRONG><FONT color="#ffffff">Create&nbsp;new file</FONT></STRONG></TD>
						<TD bgColor="background"><STRONG><FONT color="#ffffff">Create new folder</FONT></STRONG></TD>
						<TD bgColor="background"><STRONG><FONT color="#ffffff">Change site root manually</FONT></STRONG></TD>
					</TR>
					<TR>
						<TD bgColor="background">&nbsp;&nbsp; <INPUT id="fileToUpload" style="WIDTH: 156px; HEIGHT: 22px" type="file" size="6" runat="server">&nbsp;
							<asp:button id="UploadBtn" runat="server" Height="22px" Width="61px" Text="Upload"></asp:button></TD>
						<TD bgColor="highlight"><asp:textbox id="NewFileText" runat="server" Height="21px" Width="69px"></asp:textbox>&nbsp;
							<asp:button id="NewFileBtn" runat="server" Height="22px" Width="61px" Text="New File"></asp:button></TD>
						<TD bgColor="background"><asp:textbox id="NewFolderText" runat="server" Height="21px" Width="69px"></asp:textbox>&nbsp;
							<asp:button id="NewFolderBtn" runat="server" Height="22px" Width="76px" Text="New Folder"></asp:button></TD>
						<TD bgColor="background"><asp:textbox id="setRootTxt" runat="server" Height="21px" Width="69px"></asp:textbox>
							<asp:button id="setRootBtn" runat="server" Height="22px" Width="63px" Text="Set Root"></asp:button></TD>
					</TR>
				</TABLE>
			</P>
		</form>
	</body>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -