zhengbingbing %!s(int64=6) %!d(string=před) roky
rodič
revize
4c2877baae

+ 54 - 0
Web/App_Code/Configs.cs

@@ -0,0 +1,54 @@
1
+using System;
2
+using System.Web;
3
+
4
+/// <summary>
5
+/// Configs 的摘要说明
6
+/// </summary>
7
+public static class Configs
8
+{
9
+    public static System.Xml.XmlDocument xDoc;
10
+    public static System.Xml.XmlNode xNode;
11
+
12
+    static Configs()
13
+    {
14
+        xDoc = new System.Xml.XmlDocument();
15
+        xDoc.Load(HttpContext.Current.Server.MapPath("~/XmlConfig/system.config"));
16
+        xNode = xDoc.SelectSingleNode("//appSettings");
17
+    }
18
+
19
+
20
+
21
+    /// <summary>
22
+    /// 根据Key取Value值
23
+    /// </summary>
24
+    /// <param name="key"></param>
25
+    public static string GetValue(string key)
26
+    {
27
+        var xElem1 = (System.Xml.XmlElement)xNode.SelectSingleNode("//add[@key='" + key + "']");
28
+        var value = "";
29
+        value = xElem1.GetAttribute("value");
30
+        //return xElem1?.GetAttribute("value") ?? "";
31
+        return value;
32
+    }
33
+    /// <summary>
34
+    /// 根据Key修改Value
35
+    /// </summary>
36
+    /// <param name="key">要修改的Key</param>
37
+    /// <param name="value">要修改为的值</param>
38
+    public static void SetValue(string key, string value)
39
+    {
40
+
41
+        System.Xml.XmlElement xElem1;
42
+        System.Xml.XmlElement xElem2;
43
+        xElem1 = (System.Xml.XmlElement)xNode.SelectSingleNode("//add[@key='" + key + "']");
44
+        if (xElem1 != null) xElem1.SetAttribute("value", value);
45
+        else
46
+        {
47
+            xElem2 = xDoc.CreateElement("add");
48
+            xElem2.SetAttribute("key", key);
49
+            xElem2.SetAttribute("value", value);
50
+            xNode.AppendChild(xElem2);
51
+        }
52
+        xDoc.Save(HttpContext.Current.Server.MapPath("~/Configs/system.config"));
53
+    }
54
+}

+ 314 - 0
Web/App_Code/FTPHelper.cs

@@ -0,0 +1,314 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Net;
6
+using System.Text;
7
+using System.Web;
8
+
9
+/// <summary>
10
+/// FTPHelper 的摘要说明
11
+/// </summary>
12
+public class FTPHelper
13
+{
14
+    //基本设置
15
+    static private string path = @"ftp://" + Configs.GetValue("ftp") + "/";    //目标路径
16
+    static private string ftpip = Configs.GetValue("ftp");    //ftp IP地址
17
+    static private string username = Configs.GetValue("account");   //ftp用户名
18
+    static private string password = Configs.GetValue("password");   //ftp密码
19
+
20
+    //获取ftp上面的文件和文件夹
21
+    public static string[] GetFileList(string dir)
22
+    {
23
+        string[] downloadFiles;
24
+        StringBuilder result = new StringBuilder();
25
+        FtpWebRequest request;
26
+        try
27
+        {
28
+            path = @"ftp://" + Configs.GetValue("ftp") + "/";
29
+            if (!string.IsNullOrEmpty(dir))
30
+                path = path + dir + "/";
31
+            request = (FtpWebRequest)FtpWebRequest.Create(new Uri(path));
32
+            request.UseBinary = true;
33
+            request.Credentials = new NetworkCredential(username, password);//设置用户名和密码
34
+            request.Method = WebRequestMethods.Ftp.ListDirectory;
35
+            request.UseBinary = true;
36
+
37
+            WebResponse response = request.GetResponse();
38
+            StreamReader reader = new StreamReader(response.GetResponseStream());
39
+
40
+            string line = reader.ReadLine();
41
+            while (line != null)
42
+            {
43
+                result.Append(line);
44
+                result.Append("\n");
45
+                Console.WriteLine(line);
46
+                line = reader.ReadLine();
47
+            }
48
+            // to remove the trailing '\n'
49
+            result.Remove(result.ToString().LastIndexOf('\n'), 1);
50
+            reader.Close();
51
+            response.Close();
52
+            return result.ToString().Split('\n');
53
+        }
54
+        catch (Exception ex)
55
+        {
56
+            Console.WriteLine("获取ftp上面的文件和文件夹:" + ex.Message);
57
+            downloadFiles = null;
58
+            return downloadFiles;
59
+        }
60
+    }
61
+
62
+    /// <summary>
63
+    /// 获取文件大小
64
+    /// </summary>
65
+    /// <param name="file">ip服务器下的相对路径</param>
66
+    /// <returns>文件大小</returns>
67
+    public static int GetFileSize(string file)
68
+    {
69
+        StringBuilder result = new StringBuilder();
70
+        FtpWebRequest request;
71
+        try
72
+        {
73
+            request = (FtpWebRequest)FtpWebRequest.Create(new Uri(path + file));
74
+            request.UseBinary = true;
75
+            request.Credentials = new NetworkCredential(username, password);//设置用户名和密码
76
+            request.Method = WebRequestMethods.Ftp.GetFileSize;
77
+
78
+            int dataLength = (int)request.GetResponse().ContentLength;
79
+
80
+            return dataLength;
81
+        }
82
+        catch (Exception ex)
83
+        {
84
+            Console.WriteLine("获取文件大小出错:" + ex.Message);
85
+            return -1;
86
+        }
87
+    }
88
+
89
+    /// <summary>
90
+    /// 文件上传
91
+    /// </summary>
92
+    /// <param name="filePath">原路径(绝对路径)包括文件名</param>
93
+    /// <param name="objPath">目标文件夹:服务器下的相对路径 不填为根目录</param>
94
+    public static void FileUpLoad(string filePath, string objPath)
95
+    {
96
+        try
97
+        {
98
+            string url = path;
99
+            if (objPath != "")
100
+                url += objPath + "/";
101
+            try
102
+            {
103
+
104
+                FtpWebRequest reqFTP = null;
105
+                //待上传的文件 (全路径)
106
+                try
107
+                {
108
+                    FileInfo fileInfo = new FileInfo(filePath);
109
+                    using (FileStream fs = fileInfo.OpenRead())
110
+                    {
111
+                        long length = fs.Length;
112
+                        reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(url + fileInfo.Name));
113
+
114
+                        //设置连接到FTP的帐号密码
115
+                        reqFTP.Credentials = new NetworkCredential(username, password);
116
+                        //设置请求完成后是否保持连接
117
+                        reqFTP.KeepAlive = false;
118
+                        //指定执行命令
119
+                        reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
120
+                        //指定数据传输类型
121
+                        reqFTP.UseBinary = true;
122
+
123
+                        using (Stream stream = reqFTP.GetRequestStream())
124
+                        {
125
+                            //设置缓冲大小
126
+                            int BufferLength = 5120;
127
+                            byte[] b = new byte[BufferLength];
128
+                            int i;
129
+                            while ((i = fs.Read(b, 0, BufferLength)) > 0)
130
+                            {
131
+                                stream.Write(b, 0, i);
132
+                            }
133
+                            Console.WriteLine("上传文件成功");
134
+                        }
135
+                    }
136
+                }
137
+                catch (Exception ex)
138
+                {
139
+                    Console.WriteLine("上传文件失败错误为" + ex.Message);
140
+                }
141
+                finally
142
+                {
143
+
144
+                }
145
+            }
146
+            catch (Exception ex)
147
+            {
148
+                Console.WriteLine("上传文件失败错误为" + ex.Message);
149
+            }
150
+            finally
151
+            {
152
+
153
+            }
154
+        }
155
+        catch (Exception ex)
156
+        {
157
+            Console.WriteLine("上传文件失败错误为" + ex.Message);
158
+        }
159
+    }
160
+
161
+    /// <summary>
162
+    /// 删除文件
163
+    /// </summary>
164
+    /// <param name="fileName">服务器下的相对路径 包括文件名</param>
165
+    public static void DeleteFileName(string fileName)
166
+    {
167
+        try
168
+        {
169
+            FileInfo fileInf = new FileInfo(ftpip + "" + fileName);
170
+            string uri = path + fileName;
171
+            FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
172
+            // 指定数据传输类型
173
+            reqFTP.UseBinary = true;
174
+            // ftp用户名和密码
175
+            reqFTP.Credentials = new NetworkCredential(username, password);
176
+            // 默认为true,连接不会被关闭
177
+            // 在一个命令之后被执行
178
+            reqFTP.KeepAlive = false;
179
+            // 指定执行什么命令
180
+            reqFTP.Method = WebRequestMethods.Ftp.DeleteFile;
181
+            FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
182
+            response.Close();
183
+        }
184
+        catch (Exception ex)
185
+        {
186
+            Console.WriteLine("删除文件出错:" + ex.Message);
187
+        }
188
+    }
189
+
190
+    /// <summary>
191
+    /// 新建目录 上一级必须先存在
192
+    /// </summary>
193
+    /// <param name="dirName">服务器下的相对路径</param>
194
+    public static void MakeDir(string dirName)
195
+    {
196
+        try
197
+        {
198
+            string uri = path + dirName;
199
+            FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
200
+            // 指定数据传输类型
201
+            reqFTP.UseBinary = true;
202
+            // ftp用户名和密码
203
+            reqFTP.Credentials = new NetworkCredential(username, password);
204
+            reqFTP.Method = WebRequestMethods.Ftp.MakeDirectory;
205
+            FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
206
+            response.Close();
207
+        }
208
+        catch (Exception ex)
209
+        {
210
+            Console.WriteLine("创建目录出错:" + ex.Message);
211
+        }
212
+    }
213
+
214
+    /// <summary>
215
+    /// 删除目录 上一级必须先存在
216
+    /// </summary>
217
+    /// <param name="dirName">服务器下的相对路径</param>
218
+    public static void DelDir(string dirName)
219
+    {
220
+        try
221
+        {
222
+            string uri = path + dirName;
223
+            FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
224
+            // ftp用户名和密码
225
+            reqFTP.Credentials = new NetworkCredential(username, password);
226
+            reqFTP.Method = WebRequestMethods.Ftp.RemoveDirectory;
227
+            FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
228
+            response.Close();
229
+        }
230
+        catch (Exception ex)
231
+        {
232
+            Console.WriteLine("删除目录出错:" + ex.Message);
233
+        }
234
+    }
235
+
236
+    /// <summary>
237
+    /// 从ftp服务器上获得文件夹列表
238
+    /// </summary>
239
+    /// <param name="RequedstPath">服务器下的相对路径</param>
240
+    /// <returns></returns>
241
+    public static List<string> GetDirctory(string RequedstPath)
242
+    {
243
+        List<string> strs = new List<string>();
244
+        try
245
+        {
246
+            string uri = path + RequedstPath;   //目标路径 path为服务器地址
247
+            FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
248
+            // ftp用户名和密码
249
+            reqFTP.Credentials = new NetworkCredential(username, password);
250
+            reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
251
+            WebResponse response = reqFTP.GetResponse();
252
+            StreamReader reader = new StreamReader(response.GetResponseStream());//中文文件名
253
+
254
+            string line = reader.ReadLine();
255
+            while (line != null)
256
+            {
257
+                if (line.Contains("<DIR>"))
258
+                {
259
+                    string msg = line.Substring(line.LastIndexOf("<DIR>") + 5).Trim();
260
+                    strs.Add(msg);
261
+                }
262
+                line = reader.ReadLine();
263
+            }
264
+            reader.Close();
265
+            response.Close();
266
+            return strs;
267
+        }
268
+        catch (Exception ex)
269
+        {
270
+            Console.WriteLine("获取目录出错:" + ex.Message);
271
+        }
272
+        return strs;
273
+    }
274
+
275
+    /// <summary>
276
+    /// 从ftp服务器上获得文件列表
277
+    /// </summary>
278
+    /// <param name="RequedstPath">服务器下的相对路径</param>
279
+    /// <returns></returns>
280
+    public static List<string> GetFile(string RequedstPath)
281
+    {
282
+        List<string> strs = new List<string>();
283
+        try
284
+        {
285
+            string uri = path + RequedstPath;   //目标路径 path为服务器地址
286
+            FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
287
+            // ftp用户名和密码
288
+            reqFTP.Credentials = new NetworkCredential(username, password);
289
+            reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
290
+            WebResponse response = reqFTP.GetResponse();
291
+            StreamReader reader = new StreamReader(response.GetResponseStream());//中文文件名
292
+
293
+            string line = reader.ReadLine();
294
+            while (line != null)
295
+            {
296
+                if (!line.Contains("<DIR>"))
297
+                {
298
+                    string msg = line.Substring(39).Trim();
299
+                    strs.Add(msg);
300
+                }
301
+                line = reader.ReadLine();
302
+            }
303
+            reader.Close();
304
+            response.Close();
305
+            return strs;
306
+        }
307
+        catch (Exception ex)
308
+        {
309
+            Console.WriteLine("获取文件出错:" + ex.Message);
310
+        }
311
+        return strs;
312
+    }
313
+
314
+}

+ 229 - 0
Web/App_Code/UPloadFile.cs

@@ -0,0 +1,229 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Net;
6
+using System.Web;
7
+
8
+/// <summary>
9
+/// UPloadFile 的摘要说明
10
+/// </summary>
11
+public class UPloadFile
12
+{
13
+    public string ftpPath;
14
+    public string ftpUserID;
15
+    public string ftpPassword;
16
+
17
+    /// <summary>
18
+    /// 上传文件
19
+    /// </summary>
20
+    /// <param name="fileinfo">需要上传的文件</param>
21
+    public string UploadLocalToFtp(string localFile)
22
+    {
23
+        string res = "";
24
+        if (!File.Exists(localFile))
25
+        {
26
+            res = "文件:“" + localFile + "” 不存在!";
27
+            return res;
28
+        }
29
+        FileInfo fileInf = new FileInfo(localFile);
30
+        //改后文件
31
+        #region 改后文件
32
+        //string temp_filename = localFile.Split('\\').Last().Split('.')[0] + "_temp";
33
+        //string localfileAft = Path.GetDirectoryName(localFile) + "\\" + temp_filename + ".wav";
34
+        //FileInfo fileInfAft = new FileInfo(localfileAft);
35
+        #endregion
36
+        string ftpURI = "ftp://" + ftpPath + "/";
37
+        string uri = ftpURI + fileInf.Name;
38
+        //string uriAft = ftpURI + fileInfAft.Name;
39
+        FtpWebRequest reqFTP;
40
+        //20180209
41
+        //System.GC.Collect();
42
+        reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));// 根据uri创建FtpWebRequest对象   
43
+        reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);// ftp用户名和密码  
44
+        reqFTP.KeepAlive = false;// 默认为true,连接不会被关闭 // 在一个命令之后被执行  
45
+        reqFTP.Method = WebRequestMethods.Ftp.UploadFile;// 指定执行什么命令  
46
+        reqFTP.UseBinary = true;// 指定数据传输类型  
47
+        reqFTP.UsePassive = true;
48
+        reqFTP.ContentLength = fileInf.Length;// 上传文件时通知服务器文件的大小  
49
+        int buffLength = 2048;// 缓冲大小设置为2kb  
50
+        byte[] buff = new byte[buffLength];
51
+        int contentLen;
52
+
53
+        // 打开一个文件流 (System.IO.FileStream) 去读上传的文件  
54
+        //FileStream fs = fileInf.OpenRead();
55
+        using (FileStream fs = new FileStream(localFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
56
+        {
57
+            try
58
+            {
59
+                res += uri + localFile;
60
+                using (Stream strm = reqFTP.GetRequestStream())// 把上传的文件写入流
61
+                {
62
+                    //StreamReader strm = new StreamReader(fs, System.Text.Encoding.Default);
63
+                    contentLen = fs.Read(buff, 0, buffLength);// 每次读文件流的2kb 
64
+                    while (contentLen != 0)// 流内容没有结束  
65
+                    {
66
+                        // 把内容从file stream 写入 upload stream  
67
+                        strm.Write(buff, 0, contentLen);
68
+                        contentLen = fs.Read(buff, 0, buffLength);
69
+                    }
70
+                    //StringBuilder sb = new StringBuilder();
71
+                    //while (!strm.EndOfStream)
72
+                    //{
73
+                    //    sb.AppendLine(strm.ReadLine() + "<br>");
74
+                    //}
75
+                }
76
+                // 关闭两个流  
77
+                //strm.Close();
78
+                fs.Close();
79
+                res = "上传成功!";
80
+            }
81
+            catch (Exception ex)
82
+            {
83
+                res += "上传文件【" + ftpPath + "/" + fileInf.Name + "】时,发生错误:" + ex.Message + "<br/>。路径:" + localFile;
84
+            }
85
+        }
86
+        //FtpWebRequest reqFTP1;
87
+        ////20180209
88
+        ////System.GC.Collect();
89
+        //reqFTP1 = (FtpWebRequest)FtpWebRequest.Create(new Uri(uriAft));// 根据uri创建FtpWebRequest对象   
90
+        //reqFTP1.Credentials = new NetworkCredential(ftpUserID, ftpPassword);// ftp用户名和密码  
91
+        //reqFTP1.KeepAlive = false;// 默认为true,连接不会被关闭 // 在一个命令之后被执行  
92
+        //reqFTP1.Method = WebRequestMethods.Ftp.UploadFile;// 指定执行什么命令  
93
+        //reqFTP1.UseBinary = true;// 指定数据传输类型  
94
+        //reqFTP1.UsePassive = true;
95
+        //reqFTP1.ContentLength = fileInfAft.Length;// 上传文件时通知服务器文件的大小  
96
+        //int buffLengthaft = 2048;// 缓冲大小设置为2kb  
97
+        //byte[] buffaft = new byte[buffLengthaft];
98
+        //int contentLenaft;
99
+
100
+        // 打开一个文件流 (System.IO.FileStream) 去读上传的文件  
101
+        //FileStream fs = fileInf.OpenRead();
102
+        //using (FileStream fs1 = new FileStream(localfileAft, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
103
+        //{
104
+        //    try
105
+        //    {
106
+        //        res += uriAft + localfileAft;
107
+        //        using (Stream strm1 = reqFTP1.GetRequestStream())// 把上传的文件写入流
108
+        //        {
109
+        //            //StreamReader strm = new StreamReader(fs, System.Text.Encoding.Default);
110
+        //            contentLenaft = fs1.Read(buffaft, 0, buffLengthaft);// 每次读文件流的2kb 
111
+        //            while (contentLenaft != 0)// 流内容没有结束  
112
+        //            {
113
+        //                // 把内容从file stream 写入 upload stream  
114
+        //                strm1.Write(buffaft, 0, contentLenaft);
115
+        //                contentLenaft = fs1.Read(buffaft, 0, buffLengthaft);
116
+        //            }
117
+        //            //StringBuilder sb = new StringBuilder();
118
+        //            //while (!strm.EndOfStream)
119
+        //            //{
120
+        //            //    sb.AppendLine(strm.ReadLine() + "<br>");
121
+        //            //}
122
+        //        }
123
+        //        // 关闭两个流  
124
+        //        //strm.Close();
125
+        //        fs1.Close();
126
+        //        res = "上传成功!";
127
+        //    }
128
+        //    catch (Exception ex)
129
+        //    {
130
+        //        res += "上传文件【" + ftpPath + "/" + fileInf.Name + "】时,发生错误:" + ex.Message + "<br/>。路径:" + localFile;
131
+        //    }
132
+        //}
133
+        return res;
134
+    }
135
+
136
+    /// <summary>  
137
+    /// 判断ftp服务器上该目录是否存在  
138
+    /// </summary>  
139
+    /// <param name="ftpPath">FTP路径目录</param>  
140
+    /// <param name="dirName">目录上的文件夹名称</param>  
141
+    /// <returns></returns>  
142
+    private bool CheckDirectoryExist(string ftpPath, string dirName)
143
+    {
144
+        bool flag = true;
145
+        try
146
+        {
147
+            //实例化FTP连接  
148
+            FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(ftpPath + dirName);
149
+            ftp.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
150
+            ftp.Method = WebRequestMethods.Ftp.ListDirectory;
151
+            FtpWebResponse response = (FtpWebResponse)ftp.GetResponse();
152
+            response.Close();
153
+        }
154
+        catch (Exception)
155
+        {
156
+            flag = false;
157
+        }
158
+        return flag;
159
+    }
160
+
161
+    /// <summary>  
162
+    /// 创建文件夹    
163
+    /// </summary>    
164
+    /// <param name="ftpPath">FTP路径</param>    
165
+    /// <param name="dirName">创建文件夹名称</param>    
166
+    public void MakeDir(string ftpPath, string dirName)
167
+    {
168
+        FtpWebRequest reqFTP;
169
+        try
170
+        {
171
+            string ui = (ftpPath + dirName).Trim();
172
+            reqFTP = (FtpWebRequest)FtpWebRequest.Create(ui);
173
+            reqFTP.Method = WebRequestMethods.Ftp.MakeDirectory;
174
+            reqFTP.UseBinary = true;
175
+            reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
176
+            FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
177
+            Stream ftpStream = response.GetResponseStream();
178
+            ftpStream.Close();
179
+            response.Close();
180
+            //Response.Write("文件夹【" + dirName + "】创建成功!<br/>");
181
+        }
182
+        catch (Exception ex)
183
+        {
184
+            //Response.Write("新建文件夹【" + dirName + "】时,发生错误:" + ex.Message);
185
+        }
186
+
187
+    }
188
+
189
+    /// <summary>
190
+    /// 下载文件
191
+    /// </summary>
192
+    /// <param name="serverName">服务器文件名称</param>
193
+    /// <param name="localName">需要保存在本地的文件名称</param>
194
+    /// <returns>下载成功返回 true</returns>
195
+    //public bool Download(string serverName, string localName)
196
+    //{
197
+    //    bool result = false;
198
+    //    using (FileStream fs = new FileStream(localName, FileMode.OpenOrCreate))
199
+    //    {
200
+    //        try
201
+    //        {
202
+    //            string url = UrlCombine(Host, RemotePath, serverName);
203
+    //            Console.WriteLine(url);
204
+
205
+    //            FtpWebRequest request = CreateConnection(url, WebRequestMethods.Ftp.DownloadFile);
206
+    //            request.ContentOffset = fs.Length;
207
+    //            using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
208
+    //            {
209
+    //                fs.Position = fs.Length;
210
+    //                byte[] buffer = new byte[1024 * 4];
211
+    //                int count = response.GetResponseStream().Read(buffer, 0, buffer.Length);
212
+    //                while (count > 0)
213
+    //                {
214
+    //                    fs.Write(buffer, 0, count);
215
+    //                    count = response.GetResponseStream().Read(buffer, 0, buffer.Length);
216
+    //                }
217
+    //                response.GetResponseStream().Close();
218
+    //            }
219
+    //            result = true;
220
+    //        }
221
+    //        catch (WebException ex)
222
+    //        {
223
+    //            // 处理ftp连接中的异常
224
+    //        }
225
+    //    }
226
+    //    return result;
227
+    //}
228
+
229
+}

+ 2 - 2
Web/HttpHandel/CommonHelp.ashx

@@ -314,8 +314,8 @@ public class CommonHelp : IHttpHandler
314 314
 
315 315
         try
316 316
         {
317
-            bool appResult = LoodLoop();
318
-            appResult = true;
317
+            bool appResult = true;// LoodLoop();
318
+            //appResult = true;
319 319
             if (!appResult)
320 320
             {
321 321
                 reslut = "{\"msg\":false,\"infos\":\"加密狗授权过期,请联系厂家!\"}";

+ 399 - 0
Web/IVRConfig/UploadIVR.aspx

@@ -0,0 +1,399 @@
1
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UploadIVR.aspx.cs" Inherits="IVRConfig_UploadIVR" %>
2
+<html xmlns="http://www.w3.org/1999/xhtml">
3
+<head id="Head1" runat="server">
4
+    <title>IVR上传</title>
5
+    <link href="../_common/styles/global.css" rel="stylesheet" type="text/css" />
6
+    <link href="../_common/styles/dialogs.css" rel="stylesheet" type="text/css" />
7
+    <link href="../_common/styles/select.css" rel="stylesheet" type="text/css" />
8
+    <link href="../_common/styles/form.css" rel="stylesheet" type="text/css" />
9
+    <link href="../_common/styles/controls.css" rel="stylesheet" type="text/css" />
10
+    <link href="../_common/styles/nav.css" rel="stylesheet" type="text/css" />
11
+    <link href="../_grid/grid.css" rel="stylesheet" type="text/css" />
12
+    <link href="../_grid/AppGrid.css" rel="stylesheet" type="text/css" />
13
+    <link href="../_common/styles/menu.css" rel="stylesheet" type="text/css" />
14
+    <link href="../_common/styles/tabs.css" rel="stylesheet" type="text/css" />
15
+
16
+    <script src="../_common/scripts/Global.js" type="text/javascript"></script>
17
+
18
+    <script src="../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
19
+
20
+    <script src="../_common/scripts/windowinformation.js" type="text/javascript"></script>
21
+
22
+    <script src="../_common/scripts/Util.js" type="text/javascript"></script>
23
+
24
+    <script src="../_grid/action.js" type="text/javascript"></script>
25
+
26
+    <script src="../_javascripts/globalctrl.js" type="text/javascript"></script>
27
+
28
+    <script src="../Scripts/RecPlayer.js" type="text/javascript"></script>
29
+
30
+    <link rel="stylesheet" type="text/css" href="../_css/ext-all.css" />
31
+    <style type="text/css">
32
+        .wbox
33
+        {
34
+            width: 100%;
35
+            height: 100%;
36
+            border: 1px solid #849bba;
37
+            background: #FFF;
38
+            padding: 1px;
39
+        }
40
+        .lbox
41
+        {
42
+            width: 100%;
43
+            height: 100%;
44
+            padding-bottom: 4px;
45
+            padding-left: 4px;
46
+            padding-right: 4px;
47
+            background: #c6d4e4;
48
+        }
49
+        .tbox
50
+        {
51
+            height: 25px;
52
+            color: #15428b;
53
+            font-size: 14px;
54
+            cursor: move;
55
+            margin: 0px;
56
+            padding: 0px;
57
+            padding-left: 5px;
58
+            line-height: 25px; *overflow:hidden;}
59
+        .tbox img
60
+        {
61
+            float: right;
62
+            margin-right: 3px;
63
+            margin-top: 5px; *top:-28px;*position:relative;}
64
+        .nrbox
65
+        {
66
+            width: 100%;
67
+            height: auto;
68
+            border: 1px solid #849bba;
69
+            background: #dfe8f6;
70
+            margin: 0px auto;
71
+        }
72
+    </style>
73
+
74
+    <script language="javascript">
75
+        var divmark = "";
76
+        divmark += "<div id=\"divLock\" style=\"z-index:1;background-color:#AAA;filter:alpha(opacity=50);position: absolute;width:expression(this.parentNode.scrollWidth);top:expression(this.parentNode.scrollTop); left:0; height:100%;right:0; bottom:0; display:none;\"></div>";
77
+        divmark += "<div id=\"divMessageBox\"  onmousedown=\"MM_dragLayer('divMessageBox','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,0,'',false,'')\" style=\"display:none;position: absolute;top:expression(this.parentNode.scrollHeight/2-100);left:expression(this.parentNode.scrollWidth/2-100);z-index:2;\">";
78
+        divmark += "<div class=\"wbox\"><div class=\"lbox\"><h1 class=\"tbox\"><span id=\"spanTitle\"></span><img src=\"../_images/dialogclose.gif\" style=\"cursor:hand;\" onclick=\"MessageBoxClose();\" /></h1>";
79
+        divmark += "<div id=\"divContent\" class=\"nrbox\"></div></div></div></div>";
80
+        document.write(divmark);
81
+    </script>
82
+
83
+    <script language="javascript" type="text/javascript">
84
+        var frmId = "";
85
+        var win;
86
+        var winmessage;
87
+        function OpenMessage(strid, strtitle, strmessage, strwidth, btnstyle, _height) {
88
+            var btnstr = "";
89
+            switch (btnstyle) {
90
+                case 0:
91
+                    btnstr = "<div style='padding-bottom:10px; text-align:center;'><button style='width: 65px;' onclick='MessageBoxClose();'>确 定</button></div>";
92
+                    break;
93
+                case 1:
94
+                    btnstr = "<br /><div style='padding-bottom:15px; text-align:center;'><img alt='加载数据中' style='width:180px;' src='../_imgs/inprogress.gif'></div><br />";
95
+                    break;
96
+                case 2:
97
+                    btnstr = "<div style='padding-bottom:10px; text-align:center;'><button style='width: 65px;' onclick='MessageBoxClose();pagination(1);'>确 定</button></div>";
98
+                    break;
99
+                case 3:
100
+                    btnstr = "<div style='padding-bottom:10px; text-align:center;'><button style='width: 65px;' onclick='MessageBoxClose();LoadingData();'>确 定</button></div>";
101
+                    break;
102
+                case 4:
103
+                    btnstr = "<div style='padding-bottom:10px; text-align:center;'><button style='width: 65px;' onclick='MessageBoxClose();DeleteOpt();'>确 定</button>&nbsp;&nbsp;&nbsp;&nbsp;<button style='width: 65px;' onclick='MessageBoxClose();'>取 消</button></div>";
104
+                    break;
105
+                default:
106
+                    break;
107
+            }
108
+            if (_height != null) {
109
+                strmessage = "<div style='padding:0px;'>" + strmessage + "</div>" + btnstr;
110
+                document.getElementById("divMessageBox").style.height = _height;
111
+            }
112
+            else {
113
+                strmessage = "<div style='padding:10px;'>" + strmessage + "</div>" + btnstr;
114
+                document.getElementById("divMessageBox").style.height = 50;
115
+                _height = 120;
116
+            }
117
+            document.getElementById("spanTitle").innerHTML = strtitle;
118
+            document.getElementById("divContent").innerHTML = strmessage;
119
+            document.getElementById("divMessageBox").style.width = strwidth;
120
+
121
+            try {
122
+                document.getElementById("divMessageBox").style.top = (document.body.clientHeight - _height) / 2;
123
+                document.getElementById("divMessageBox").style.left = (document.body.clientWidth - strwidth) / 2;
124
+            }
125
+            catch (e)
126
+            { }
127
+            document.getElementById("divLock").style.display = "block";
128
+            document.getElementById("divMessageBox").style.display = "block";
129
+        }
130
+        function OpenWindowPage(_title, _id, _width, _height, _url) {
131
+            var html = "<iframe id='" + _id + "' src='" + _url + "' style='width:100%; height:" + _height + ";'></iframe>";
132
+            OpenMessage(_id, _title, html, _width, -1, _height);
133
+        }
134
+        function MessageBoxClose() {
135
+            document.getElementById("divLock").style.display = "none";
136
+            document.getElementById("divMessageBox").style.display = "none";
137
+        }
138
+        function CloseWindowPage(type) {
139
+            MessageBoxClose();
140
+        }
141
+
142
+    </script>
143
+
144
+    <script language="javascript" type="text/javascript">
145
+
146
+        var pageIndex = "";
147
+        var _searchitems;
148
+        function Init() {
149
+
150
+            pagination(1);
151
+        }
152
+
153
+
154
+        function pagination(index) {
155
+            pageIndex = index;
156
+            LoadingData();
157
+        }
158
+        function GetSearchOperationsObj() {
159
+            _searchitems = new Array;
160
+            _searchitems[0] = pageIndex;
161
+            _searchitems[1] = 20;
162
+            _searchitems[2] = GetSql();
163
+
164
+        }
165
+
166
+        //获取sql
167
+        function GetSql() {
168
+            var strWhere = "";
169
+            
170
+            return strWhere;
171
+
172
+        }
173
+        function LoadingData() {
174
+            try {
175
+                //OpenMessage('framemessage', '加载数据', '正在读取数据...', 220, 1);
176
+            }
177
+            catch (e) {
178
+                OpenMessage('framemessage', '加载数据', e.message, 220, 0);
179
+            }
180
+            finally {
181
+            }
182
+        }
183
+
184
+        function LoadingData_callback(res) {
185
+            document.getElementById("divDataItems").innerHTML = res.value;
186
+            res = null;
187
+            MessageBoxClose();
188
+        }
189
+        document.onkeyup = click;
190
+        function click() {
191
+            if (event.keyCode == 13) {
192
+                document.all("btnSelect").click();
193
+            }
194
+        }
195
+
196
+
197
+        //操作
198
+        function Operate(type, id, callid, phone) {
199
+            switch (type) {
200
+                case 'deal':
201
+                    addBusiness(phone, callid);
202
+                    break;
203
+                case 'cancle':
204
+                    if (confirm("您确定要替换掉原来的文件么?")) {
205
+                        var userid = document.getElementById("hfUserId").value;
206
+                        var userCode = document.getElementById("hfUserCode").value;
207
+                        var userName = document.getElementById("hfUserName").value;
208
+
209
+                        var result = CallManage_LeaveVoice.Cancle(callid, userid, userCode, userName).value;
210
+                        if (result == "success") {
211
+                            OpenMessage('framemessage', '提示', "操作成功", 220, 3);
212
+                        }
213
+                        else if (result == "fail") {
214
+                            OpenMessage('framemessage', '提示', "操作失败", 220, 0);
215
+                        }
216
+                        else {
217
+                            OpenMessage('framemessage', '提示', "操作异常", 220, 0);
218
+                        }
219
+                    }
220
+
221
+                    break;
222
+            }
223
+        }
224
+
225
+
226
+    </script>
227
+
228
+</head>
229
+<body onload="Init()">
230
+    <form id="form1" runat="server">
231
+    <asp:HiddenField ID="hfPlayPath" runat="server" />
232
+    <asp:HiddenField ID="hfUserId" runat="server" />
233
+    <asp:HiddenField ID="hfUserCode" runat="server" />
234
+    <asp:HiddenField ID="hfUserName" runat="server" />
235
+    <table class="stdTable" cellspacing="0" cellpadding="0">
236
+        <colgroup>
237
+            <col width="160">
238
+            <col>
239
+        </colgroup>
240
+        <tbody>
241
+            <tr height="100%">
242
+                <td colspan="2">
243
+                    <table class="stdTable" style="background-color: #DBEBF8" cellspacing="0" cellpadding="0">
244
+                        <colgroup>
245
+                            <col width="200">
246
+                            <col>
247
+                        </colgroup>
248
+                        <tbody>
249
+                            <tr>
250
+                                <td style="padding-right: 8px; border-top: #A0A2AF 1px solid; padding-left: 8px;
251
+                                    padding-bottom: 8px; border-left: #A0A2AF 1px solid; padding-top: 0px; border-bottom: #A0A2AF 1px solid">
252
+                                    <table class="stdTable" cellspacing="0" cellpadding="0">
253
+                                        <colgroup>
254
+                                            <col width="8">
255
+                                            <col>
256
+                                            <col width="8">
257
+                                        </colgroup>
258
+                                        <tbody>
259
+                                            <tr height="28">
260
+                                                <td rowspan="2" style="width: 7px">
261
+                                                </td>
262
+                                                <td style="padding-top: 5px;">
263
+                                                    <table class="tabBar" cellspacing="0" cellpadding="0">
264
+                                                        <tbody>
265
+                                                            <tr>
266
+                                                                <td id="tabs" valign="bottom" nowrap>
267
+                                                                    <span class="tab tabOn" id="tabFront" tabindex="1" tabid="tab0">上传文件</span>
268
+                                                                </td>
269
+                                                            </tr>
270
+                                                        </tbody>
271
+                                                    </table>
272
+                                                    <hr class="tabGlow" id="hrSelectedTab">
273
+                                                    <hr class="tabGlow" id="hrGlowTab">
274
+                                                </td>
275
+                                                <td>
276
+                                                    <br>
277
+                                                </td>
278
+                                            </tr>
279
+                                            <tr height="100%">
280
+                                                <td colspan="2">
281
+                                                    <div id="tab0">
282
+                                                        <table id="main" height="100%" cellspacing="0" cellpadding="1" width="100%">
283
+                                                            <tbody>
284
+                                                                <tr valign="top">
285
+                                                                    <td>
286
+                                                                        <div class="tab" id="searchDiv" style="display: inline">
287
+                                                                            <table id="SearchPanelInt" height="100%" cellspacing="0" cellpadding="1" width="100%">
288
+                                                                                <tbody>
289
+                                                                                    <tr>
290
+                                                                                        <td style="padding-top: 5px">
291
+                                                                                            上传类型:
292
+                                                                                            <div style="padding-top: 2px">
293
+                                                                                                <asp:DropDownList ID="ddlType" runat="server"  CssClass="selectBox" AutoPostBack="True" OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
294
+                                                                                                    <asp:ListItem Value="ivr">IVR文件</asp:ListItem>
295
+                                                                                                    <asp:ListItem Value="wav">语音文件</asp:ListItem>
296
+                                                                                                </asp:DropDownList>
297
+                                                                                            </div>
298
+                                                                                        </td>
299
+                                                                                    </tr>
300
+                                                                                    <tr>
301
+                                                                                        <td style="padding-top: 5px">
302
+                                                                                            <div style="padding-top: 2px">
303
+                                                                                                <input type="file" id="FileUpload1" class="txt" runat="server" />
304
+                                                                                            </div>
305
+                                                                                        </td>
306
+                                                                                    </tr>
307
+                                                                                    <tr>
308
+                                                                                        <td style="padding-top: 5px" valign="top" align="right" height="100%">
309
+                                                                                            <button title="上传" style="width: 60px;" onclick="pagination('1');" tabindex="5" id="btnSelect">
310
+                                                                                                上传</button>
311
+                                                                                        </td>
312
+                                                                                    </tr>
313
+                                                                                </tbody>
314
+                                                                            </table>
315
+                                                                        </div>
316
+                                                                    </td>
317
+                                                                </tr>
318
+                                                            </tbody>
319
+                                                        </table>
320
+                                                    </div>
321
+                                                </td>
322
+                                            </tr>
323
+                                        </tbody>
324
+                                    </table>
325
+                                </td>
326
+                                <td>
327
+                                    <div id="divDataItems">
328
+                                        <asp:Repeater ID="rptItems" runat="server">
329
+                                            <HeaderTemplate>
330
+                                                <table class="gridControl gridArea" id="crmGrid" cellspacing="0" cellpadding="0">
331
+                                                <tbody>
332
+                                                    <tr>
333
+                                                        <td>
334
+                                                            <div style="height: 99.9%">
335
+                                                                <table class="gridArea" cellspacing="0" cellpadding="0">
336
+                                                                    <tbody>
337
+                                                                        <tr>
338
+                                                                            <td>
339
+                                                                                <div id="fixedrow" style="overflow-x: hidden; width: 100%">
340
+                                                                                    <table class="gridBar" id="gridBar" style="border-bottom: #a0a0a4 1px solid" cellspacing="0"
341
+                                                                                        cellpadding="0">
342
+                                                                                        <colgroup id="crmGrid_gridBarCols">
343
+                                                                                            <col style="padding-left: 0px" width="28">
344
+                                                                                            <col class="grid" width="60%" name="f1">
345
+                                                                                        </colgroup>
346
+                                                                                        <tbody>
347
+                                                                                            <tr height="20">
348
+                                                                                                <td align="middle">
349
+                                                                                                </td>
350
+                                                                                                <td field="f1">
351
+                                                                                                    <nobr>
352
+                                                                                                       文件</nobr>
353
+                                                                                                </td>
354
+                                                                                            </tr>
355
+                                                                                        </tbody>
356
+                                                                                    </table>
357
+                                                                                </div>
358
+                                                                            </td>
359
+                                                                        </tr>
360
+                                                                        <tr valign="top" height="100%">
361
+                                                                            <td>
362
+                                                                                <div class="gdDataBody" id="divDataBody">
363
+                                                                                    <table class="gridArea" cellspacing="0" cellpadding="0">
364
+                                                                                        <tbody>
365
+                                                                                            <tr>
366
+                                                                                                <td id="tdDataArea">
367
+                                                                                                    <div class="gdDataArea" id="divDataArea">
368
+                                                                                                        <table class="gridData" id="gridBodyTable" tabindex="0" cellspacing="0" cellpadding="1"
369
+                                                                                                            morerecords="0" oname="">
370
+                                                                                                            <colgroup>
371
+                                                                                                                <col style="padding-left: 10px;" width="60%" name="f1">
372
+                                                                                                            </colgroup>
373
+                                                                                                            <tbody>
374
+                                            </HeaderTemplate>
375
+                                            <ItemTemplate>
376
+                                                <tr class="grid" >
377
+                                                    <td class="grid">
378
+                                                        <nobr>
379
+                                                          <%# Eval("filename")%>&nbsp;
380
+                                                        </nobr>
381
+                                                    </td>
382
+                                                </tr>
383
+                                            </ItemTemplate>
384
+                                            <FooterTemplate>
385
+                                                </tbody> </table> </div> </td> </tr> </tbody> </table> </div> </td> </tr> </tbody> </table> </div></td> </tr></tbody> </table>
386
+                                            </FooterTemplate>
387
+                                        </asp:Repeater>
388
+                                    </div>
389
+                                </td>
390
+                            </tr>
391
+                        </tbody>
392
+                    </table>
393
+                </td>
394
+            </tr>
395
+        </tbody>
396
+    </table>
397
+    </form>
398
+</body>
399
+</html>

+ 127 - 0
Web/IVRConfig/UploadIVR.aspx.cs

@@ -0,0 +1,127 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Web;
6
+using System.Web.UI;
7
+using System.Web.UI.WebControls;
8
+
9
+public partial class IVRConfig_UploadIVR : System.Web.UI.Page
10
+{
11
+    protected void Page_Load(object sender, EventArgs e)
12
+    {
13
+        if(!IsPostBack)
14
+        {
15
+            GetFileList(ddlType.SelectedValue);
16
+        }
17
+    }
18
+
19
+    
20
+    private void GetFileList(string dir)
21
+    {
22
+        var strs = FTPHelper.GetFileList(dir);
23
+        var lists = new List<object>();
24
+        if (strs != null && strs.Length > 0)
25
+        {
26
+            foreach (var str in strs)
27
+            {
28
+                var obj = new
29
+                {
30
+                    filename = str
31
+                };
32
+                lists.Add(obj);
33
+            }
34
+        }
35
+
36
+        rptItems.DataSource = lists;
37
+        rptItems.DataBind();
38
+    }
39
+
40
+    private string UpLoadProcess(string dir,FileUpload file)
41
+    {
42
+        try
43
+        {
44
+            if (file == null) return "参数传入失败";
45
+            if (Request.Files.Count == 0) return "保存失败";
46
+
47
+            //string userCode = txtAgentCode.Value;
48
+            string filePathName = string.Empty;
49
+            #region 保存文件到本地路径
50
+            string path = "/UploadFiles/" + DateTime.Now.ToString("yyyy/MM/dd") + "/";
51
+            if (!string.IsNullOrEmpty(dir))
52
+                path = path + dir + "/";
53
+            string localPath = Server.MapPath(Path.Combine(HttpRuntime.AppDomainAppPath, path));
54
+            string ex = Path.GetExtension(file.FileName);
55
+            string oriname = Path.GetFileNameWithoutExtension(file.FileName);
56
+            filePathName = oriname + "_" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ex;
57
+            if (!System.IO.Directory.Exists(localPath))
58
+            {
59
+                System.IO.Directory.CreateDirectory(localPath);
60
+            }
61
+            string physicalpath = Path.Combine(localPath, filePathName);
62
+            file.SaveAs(physicalpath);
63
+            #endregion
64
+            #region 读取配置的上传路径-原文件和修改过格式的文件均上传至此
65
+            string savedir = Configs.GetValue("saveloc");
66
+            if (!System.IO.Directory.Exists(savedir))
67
+            {
68
+                System.IO.Directory.CreateDirectory(savedir);
69
+            }
70
+            #endregion
71
+            if (!string.IsNullOrEmpty(physicalpath))
72
+            {
73
+                #region 上传到ftp
74
+                UPloadFile upfile = new UPloadFile();
75
+                //通过读取配置文件,获取数据库
76
+                string _ftp = Configs.GetValue("ftp");
77
+                string _acc = Configs.GetValue("account");
78
+                string _pwd = Configs.GetValue("password");
79
+
80
+                upfile.ftpPath = _ftp;
81
+                upfile.ftpUserID = _acc;
82
+                upfile.ftpPassword = _pwd;
83
+                string uploadBeforres = upfile.UploadLocalToFtp(physicalpath);
84
+                #endregion
85
+                if (uploadBeforres.Equals("上传成功!"))
86
+                {
87
+                    return "上传成功!";
88
+                    #region
89
+                    //#region 添加日志
90
+                    //Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
91
+                    //model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
92
+                    //model_T_Sys_Accessories.F_FileName = filePathName;//附件名称
93
+                    //model_T_Sys_Accessories.F_FileType = type;//附件类型
94
+                    //model_T_Sys_Accessories.F_FileUrl = (filePathName).Replace('\\', '/');//附件地址
95
+                    //model_T_Sys_Accessories.F_Size = size;
96
+                    //model_T_Sys_Accessories.F_UserCode = userCode;//上传人  
97
+                    //model_T_Sys_Accessories.F_OriName = oriname;
98
+                    //int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
99
+                    //#endregion
100
+                    //if (fid > 0)
101
+                    //{
102
+                    //    //返回附件的ID
103
+                    //    model_T_Sys_Accessories.F_FileId = fid;//修改为返回对象以便查看图片
104
+                    //    return "文件上传成功";//, model_T_Sys_Accessories);
105
+                    //}
106
+                    //else
107
+                    //    return "文件上传成功,日志记录失败";
108
+                    #endregion
109
+                }
110
+                else
111
+                    return "文件上传失败,请重新上传,失败原因:" + uploadBeforres;
112
+            }
113
+            else
114
+                return "格式修改出错,请重新上传";
115
+        }
116
+        catch (Exception ex)
117
+        {
118
+            return ex.Message;
119
+        }
120
+    }
121
+
122
+
123
+    protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
124
+    {
125
+        GetFileList(ddlType.SelectedValue);
126
+    }
127
+}

+ 21 - 0
Web/XmlConfig/system.config

@@ -0,0 +1,21 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<appSettings>
3
+  <!-- ================== 1:系统软件参数配置 ================== -->
4
+  <!-- 联系我们 -->
5
+  <add key="Contact" value="www.800100.net" />
6
+  <!-- 软件名称 -->
7
+  <add key="SoftName" value="河南加一信息科技有限公司" />
8
+  <!-- 软件版本 -->
9
+  <add key="Version" value="3.0.0" />
10
+  <!-- 软件授权码-->
11
+  <add key="LicenceKey" value="" />
12
+  <!-- ================== 5:IVR文件上传FTP配置参数 ================== -->
13
+  <!-- 设置FTP -->
14
+  <add key="ftp" value="192.168.4.18" />
15
+  <!-- 设置账户名 -->
16
+  <add key="account" value="bingbing" />
17
+  <!-- 设置密码 -->
18
+  <add key="password" value="Bing123456" />
19
+  <!-- 文件保存位置 -->
20
+  <add key="saveloc" value="\UpLoadFiles\" />
21
+</appSettings>

binární
Web/_framepage/images/qcnull.png


binární
Web/_framepage/images/qr.png


+ 1 - 1
Web/_framepage/mainPage.aspx.cs

@@ -25,7 +25,7 @@ public partial class _framepage_mainPage : System.Web.UI.Page
25 25
 
26 26
         if (!this.IsPostBack)
27 27
         {
28
-            ShowAccess();
28
+            //ShowAccess();
29 29
         }
30 30
     }
31 31
 

+ 1 - 0
Web/web.config

@@ -69,6 +69,7 @@
69 69
         </customErrors>
70 70
         -->
71 71
     <customErrors mode="Off"/>
72
+    <globalization requestEncoding="gb2312" responseEncoding="gb2312"/>
72 73
     <pages>
73 74
       <controls>
74 75
         <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>