1
using System;
2
using System.Collections;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Web;
7
using System.Web.SessionState;
8
using System.Web.UI;
9
using System.Web.UI.WebControls;
10
using System.Web.UI.HtmlControls;
11
using System.IO;
12
namespace UploadFile
13

{
14
/**//// <summary>
15
/// Summary description for WebForm1.
16
/// </summary>
17
public partial class UploadPage : System.Web.UI.Page
18
{
19
private void Page_Load(object sender, System.EventArgs e)
20
{
21
try
22
{
23
string strXML = Request.QueryString["DefXML"];
24
25
string strFolder = "C:\\UploadFiles\\";
26
if (!System.IO.Directory.Exists(strFolder))
27
{
28
System.IO.Directory.CreateDirectory(strFolder);
29
}
30
string strFileName = strFolder + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + ".xml";
31
FileStream fs = new System.IO.FileStream(strFileName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite);
32
StreamWriter sw = new System.IO.StreamWriter(fs);
33
sw.WriteLine(strXML);
34
sw.Flush();
35
sw.Close();
36
fs.Close();
37
Response.Write(strXML + "! File Save OK!");
38
}
39
catch (Exception ex)
40
{
41
Response.Write(ex.Message);
42
}
43
// Put user code to initialize the page here
44
}
45
46
// #region Web Form Designer generated code
47
//override protected void OnInit(EventArgs e)
48
// {
49
// //
50
// // CODEGEN: This call is required by the ASP.NET Web Form Designer.
51
// //
52
// InitializeComponent();
53
// base.OnInit(e);
54
// }
55
56
// /// <summary>
57
// /// Required method for Designer support - do not modify
58
// /// the contents of this method with the code editor.
59
// /// </summary>
60
// private void InitializeComponent()
61
// {
62
// this.Load += new System.EventHandler(this.Page_Load);
63
// }
64
// #endregion
65
}
66
}
67

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

58

59

60

61

62

63

64

65

66

67
