问:通常一个网站程序发布在一个iis服务器上,但是如果要分布式部署网站。文件系统该如何存储呢?

答:通常的就是给网站文件系统一个子域名。比如 https://images.web.com. 网站程序内部通过代码调用ftp服务器-每次用户上传文件直接上传到相应imags域名对应的目录。

问:如果网站的图片,文件部署在子域名 网站该如何调用呢?

答:在视图模板里面 直接读取配置的images 域名  程序如下。。。

  1. public class AppConfig
  2. {
  3. /// <summary>
  4. /// 上传文件存放文件夹
  5. /// </summary>
  6. public static string FileSaveBasePath = ConfigurationManager.AppSettings["FileSaveBasePath"].ToString();
  7.  
  8. /// <summary>
  9. /// ftpip
  10. /// </summary>
  11. public static string FtpServerIP = ConfigurationManager.AppSettings["FtpServerIP"].ToString();
  12.  
  13. /// <summary>
  14. /// ftp登陆名
  15. /// </summary>
  16. public static string FtpUserId = ConfigurationManager.AppSettings["FtpUserId"].ToString();
  17.  
  18. /// <summary>
  19. /// ftp登陆密码
  20. /// </summary>
  21. public static string FtpPassword = ConfigurationManager.AppSettings["FtpPassword"].ToString();
  22.  
  23. /// <summary>
  24. /// ftp上html的基础路径
  25. /// </summary>
  26. public static string FtpHtmlBasePath = ConfigurationManager.AppSettings["FtpHtmlBasePath"].ToString();
  27.  
  28. /// <summary>
  29. /// ftp上file的基础路径
  30. /// </summary>
  31. public static string FtpFileBasePath = ConfigurationManager.AppSettings["FtpFileBasePath"].ToString();
  32.  
  33. /// <summary>
  34. /// 是否需要ftp上传
  35. /// </summary>
  36. public static bool FtpUpload
  37. {
  38. get
  39. {
  40. bool flag = false;
  41. if (bool.TryParse(ConfigurationManager.AppSettings["FtpUpload"].ToString(), out flag))
  42. return flag;
  43. else
  44. return false;
  45. }
  46. }
  47. }
  1. /// <summary>
  2. /// 创建图片文件
  3. /// </summary>
  4. /// <param name="btImage">图片二进制字符串</param>
  5. /// <param name="imageName">文件相对路径+文件名</param>
  6. /// <returns></returns>
  7. public bool CreateFileImage(byte[] image, string readPath)
  8. {
  9. if (image == null)
  10. return false;
  11. try
  12. {
  13. bool flag = true;
  14. string errorinfo = string.Empty;
  15. isCreateDir(path + readPath);
  16. System.IO.File.WriteAllBytes(path + readPath, image);
  17. Loger.Info(string.Format("方法名:{0},创建图片文件成功,文件路径:{1}", "CreateFileImage", path + readPath));
  18. //ftp上传操作
  19. flag = FtpUpload(path + readPath, readPath, AppConfig.FtpFileBasePath, out errorinfo);
  20. return flag;
  21. }
  22. catch (Exception ex)
  23. {
  24. Loger.Info(string.Format("方法名:{0},创建图片文件失败!", "CreateFileImage"));
  25. Loger.Error(ex);
  26. return false;
  27. }
  28. }
  1. public bool FtpUpload(string fileLocalPath, string filePath, string fileFtpPath, out string errorInfo)
  2. {
  3. bool flag = true;
  4. errorInfo = string.Empty;
  5. if (AppConfig.FtpUpload)
  6. {
  7. FtpHelper ftp = new FtpHelper();
  8. ftp.FtpUpDown(AppConfig.FtpServerIP, AppConfig.FtpUserId, AppConfig.FtpPassword);
  9. string directory = FileHelper.GetFileDirectory(filePath);//获取该文件的文件路径结构
  10. if (!string.IsNullOrEmpty(directory) && directory != "/" && directory != "\\")
  11. {
  12. //ftp.MakeDir(fileFtpPath + directory);
  13. directory = directory.TrimStart('/').TrimEnd('/');
  14. string[] dirs = directory.Split('/');
  15. string ftpCreateDir = fileFtpPath;
  16. //创建ftp目录,目前只能一级一级创建
  17. for (int i = ; i < dirs.Length; i++)
  18. {
  19. ftpCreateDir += "/" + dirs[i] + "/";
  20. ftp.MakeDir(ftpCreateDir);
  21. }
  22.  
  23. }
  24. flag = ftp.Upload(fileLocalPath, fileFtpPath + filePath, out errorInfo);
  25. if (flag)
  26. Loger.Info(string.Format("上传ftp文件成功,文件路径:{0},{1}", fileFtpPath + filePath, errorInfo));
  27. else
  28. Loger.Warn(string.Format("上传ftp文件失败,文件路径:{0},{1}", fileFtpPath + filePath, errorInfo));
  29. }
  30. return flag;
  31. }
  1. public class FtpHelper
  2. {
  3. string ftpServerIP;
  4. string ftpUserID;
  5. string ftpPassword;
  6. FtpWebRequest reqFTP;
  7.  
  8. //public void Connecttest(string ftpServerIP, string ftpUserID, string ftpPassword)
  9. //{
  10. // // 根据uri创建FtpWebRequest对象
  11. // reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP));
  12. // // 指定数据传输类型
  13. // reqFTP.UseBinary = true;
  14. // // ftp用户名和密码
  15. // reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
  16. //}
  17.  
  18. #region 连接
  19. /// <summary>
  20. /// 连接
  21. /// </summary>
  22. /// <param name="path"></param>
  23. private void Connect(String path)//连接ftp
  24. {
  25. // 根据uri创建FtpWebRequest对象
  26. reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(path));
  27. // 指定数据传输类型
  28. reqFTP.UseBinary = true;
  29. // ftp用户名和密码
  30. reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
  31. }
  32. #endregion
  33.  
  34. #region ftp登录信息
  35. /// <summary>
  36. /// ftp登录信息
  37. /// </summary>
  38. /// <param name="ftpServerIP">ftpServerIP</param>
  39. /// <param name="ftpUserID">ftpUserID</param>
  40. /// <param name="ftpPassword">ftpPassword</param>
  41. public void FtpUpDown(string ftpServerIP, string ftpUserID, string ftpPassword)
  42. {
  43. this.ftpServerIP = ftpServerIP;
  44. this.ftpUserID = ftpUserID;
  45. this.ftpPassword = ftpPassword;
  46. }
  47. #endregion
  48.  
  49. #region 获取文件列表
  50. /// <summary>
  51. /// 获取文件列表
  52. /// </summary>
  53. /// <param name="path"></param>
  54. /// <param name="WRMethods"></param>
  55. /// <returns></returns>
  56. private string[] GetFileList(string path, string WRMethods)//上面的代码示例了如何从ftp服务器上获得文件列表
  57. {
  58. string[] downloadFiles;
  59. StringBuilder result = new StringBuilder();
  60. try
  61. {
  62. Connect(path);
  63. reqFTP.Method = WRMethods;
  64. WebResponse response = reqFTP.GetResponse();
  65. StreamReader reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.UTF8);//中文文件名
  66. string line = reader.ReadLine();
  67. while (line != null)
  68. {
  69. result.Append(line);
  70. result.Append("\n");
  71. line = reader.ReadLine();
  72. }
  73. // to remove the trailing '\n'
  74. int lastIndex = result.ToString().LastIndexOf('\n');
  75. if (lastIndex > -)
  76. result.Remove(lastIndex, );
  77. reader.Close();
  78. response.Close();
  79. return result.ToString().Split('\n');
  80. }
  81. catch (Exception ex)
  82. {
  83. //System.Windows.Forms.MessageBox.Show(ex.Message);
  84. Loger.Error(ex);
  85. downloadFiles = null;
  86. return downloadFiles;
  87. }
  88. }
  89. public string[] GetFileList(string path)//上面的代码示例了如何从ftp服务器上获得文件列表
  90. {
  91. return GetFileList("ftp://" + ftpServerIP + "/" + path, WebRequestMethods.Ftp.ListDirectory);
  92. }
  93. public string[] GetFileList()//上面的代码示例了如何从ftp服务器上获得文件列表
  94. {
  95. return GetFileList("ftp://" + ftpServerIP + "/", WebRequestMethods.Ftp.ListDirectory);
  96. }
  97. #endregion
  98.  
  99. #region 上传文件
  100. /// <summary>
  101. /// 上传文件
  102. /// </summary>
  103. /// <param name="filename"></param>
  104. public bool Upload(string filename, string path, out string errorinfo) //上面的代码实现了从ftp服务器上载文件的功能
  105. {
  106. path = path.Replace("\\", "/");
  107. FileInfo fileInf = new FileInfo(filename);
  108. string a = fileInf.Directory.Name;
  109. string uri = "ftp://" + ftpServerIP + "/" + path;
  110. Connect(uri);//连接
  111. // 默认为true,连接不会被关闭
  112. // 在一个命令之后被执行
  113. reqFTP.KeepAlive = false;
  114. // 指定执行什么命令
  115. reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
  116. // 上传文件时通知服务器文件的大小
  117. reqFTP.ContentLength = fileInf.Length;
  118. // 缓冲大小设置为kb
  119. int buffLength = ;
  120. byte[] buff = new byte[buffLength];
  121. int contentLen;
  122. // 打开一个文件流(System.IO.FileStream) 去读上传的文件
  123. FileStream fs = fileInf.OpenRead();
  124. try
  125. {
  126. // 把上传的文件写入流
  127. Stream strm = reqFTP.GetRequestStream();
  128. // 每次读文件流的kb
  129. contentLen = fs.Read(buff, , buffLength);
  130. // 流内容没有结束
  131. while (contentLen != )
  132. {
  133. // 把内容从file stream 写入upload stream
  134. strm.Write(buff, , contentLen);
  135. contentLen = fs.Read(buff, , buffLength);
  136. }
  137. // 关闭两个流
  138. strm.Close();
  139. fs.Close();
  140. errorinfo = "完成";
  141. return true;
  142. }
  143. catch (Exception ex)
  144. {
  145. errorinfo = string.Format("因{0},无法完成上传", ex.Message);
  146. return false;
  147. }
  148. }
  149. #endregion
  150.  
  151. #region 续传文件
  152. /// <summary>
  153. /// 续传文件
  154. /// </summary>
  155. /// <param name="filename"></param>
  156. public bool Upload(string filename, long size, string path, out string errorinfo) //上面的代码实现了从ftp服务器上载文件的功能
  157. {
  158. path = path.Replace("\\", "/");
  159. FileInfo fileInf = new FileInfo(filename);
  160. //string uri = "ftp://" + path + "/" + fileInf.Name;
  161. string uri = "ftp://" + path;
  162. Connect(uri);//连接
  163. // 默认为true,连接不会被关闭
  164. // 在一个命令之后被执行
  165. reqFTP.KeepAlive = false;
  166. // 指定执行什么命令
  167. reqFTP.Method = WebRequestMethods.Ftp.AppendFile;
  168. // 上传文件时通知服务器文件的大小
  169. reqFTP.ContentLength = fileInf.Length;
  170. // 缓冲大小设置为kb
  171. int buffLength = ;
  172. byte[] buff = new byte[buffLength];
  173. int contentLen;
  174. // 打开一个文件流(System.IO.FileStream) 去读上传的文件
  175. FileStream fs = fileInf.OpenRead();
  176. try
  177. {
  178. StreamReader dsad = new StreamReader(fs);
  179. fs.Seek(size, SeekOrigin.Begin);
  180. // 把上传的文件写入流
  181. Stream strm = reqFTP.GetRequestStream();
  182. // 每次读文件流的kb
  183. contentLen = fs.Read(buff, , buffLength);
  184. // 流内容没有结束
  185. while (contentLen != )
  186. {
  187. // 把内容从file stream 写入upload stream
  188. strm.Write(buff, , contentLen);
  189. contentLen = fs.Read(buff, , buffLength);
  190. }
  191. // 关闭两个流
  192. strm.Close();
  193. fs.Close();
  194. errorinfo = "完成";
  195. return true;
  196. }
  197. catch (Exception ex)
  198. {
  199. errorinfo = string.Format("因{0},无法完成上传", ex.Message);
  200. return false;
  201. }
  202. }
  203. #endregion
  204.  
  205. #region 下载文件
  206. /// <summary>
  207. /// 下载文件
  208. /// </summary>
  209. /// <param name="filePath"></param>
  210. /// <param name="fileName"></param>
  211. /// <param name="errorinfo"></param>
  212. /// <returns></returns>
  213. public bool Download(string ftpfilepath, string filePath, string fileName, out string errorinfo)////上面的代码实现了从ftp服务器下载文件的功能
  214. {
  215. try
  216. {
  217. filePath = filePath.Replace("我的电脑\\", "");
  218. String onlyFileName = Path.GetFileName(fileName);
  219. string newFileName = filePath + onlyFileName;
  220. if (File.Exists(newFileName))
  221. {
  222. errorinfo = string.Format("本地文件{0}已存在,无法下载", newFileName);
  223. return false;
  224. }
  225. ftpfilepath = ftpfilepath.Replace("\\", "/");
  226. string url = "ftp://" + ftpfilepath;
  227. Connect(url);//连接
  228. reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
  229. FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
  230. Stream ftpStream = response.GetResponseStream();
  231. long cl = response.ContentLength;
  232. int bufferSize = ;
  233. int readCount;
  234. byte[] buffer = new byte[bufferSize];
  235. readCount = ftpStream.Read(buffer, , bufferSize);
  236. FileStream outputStream = new FileStream(newFileName, FileMode.Create);
  237. while (readCount > )
  238. {
  239. outputStream.Write(buffer, , readCount);
  240. readCount = ftpStream.Read(buffer, , bufferSize);
  241. }
  242. ftpStream.Close();
  243. outputStream.Close();
  244. response.Close();
  245. errorinfo = "";
  246. return true;
  247. }
  248. catch (Exception ex)
  249. {
  250. errorinfo = string.Format("因{0},无法下载", ex.Message);
  251. return false;
  252. }
  253. }
  254. #endregion
  255.  
  256. #region 删除文件
  257. /// <summary>
  258. /// 删除文件
  259. /// </summary>
  260. /// <param name="fileName"></param>
  261. public void DeleteFileName(string fileName)
  262. {
  263. try
  264. {
  265. FileInfo fileInf = new FileInfo(fileName);
  266. string uri = "ftp://" + ftpServerIP + "/" + fileInf.Name;
  267. Connect(uri);//连接
  268. // 默认为true,连接不会被关闭
  269. // 在一个命令之后被执行
  270. reqFTP.KeepAlive = false;
  271. // 指定执行什么命令
  272. reqFTP.Method = WebRequestMethods.Ftp.DeleteFile;
  273. FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
  274. response.Close();
  275. }
  276. catch (Exception ex)
  277. {
  278. //MessageBox.Show(ex.Message, "删除错误");
  279. }
  280. }
  281. #endregion
  282.  
  283. #region 在ftp上创建目录
  284. /// <summary>
  285. /// 在ftp上创建目录
  286. /// </summary>
  287. /// <param name="dirName"></param>
  288. public void MakeDir(string dirName)
  289. {
  290. try
  291. {
  292. string uri = "ftp://" + ftpServerIP +"/" + dirName;
  293. Connect(uri);//连接
  294. reqFTP.Method = WebRequestMethods.Ftp.MakeDirectory;
  295. FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
  296. response.Close();
  297. }
  298. catch (Exception ex)
  299. {
  300. //不输出异常,目前ftp只支持多级目录的一层层创建
  301. //Loger.Debug(ex);
  302. }
  303. }
  304. #endregion
  305.  
  306. #region 删除ftp上目录
  307. /// <summary>
  308. /// 删除ftp上目录
  309. /// </summary>
  310. /// <param name="dirName"></param>
  311. public void delDir(string dirName)
  312. {
  313. try
  314. {
  315. string uri = "ftp://" + ftpServerIP + "/" + dirName;
  316. Connect(uri);//连接
  317. reqFTP.Method = WebRequestMethods.Ftp.RemoveDirectory;
  318. FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
  319. response.Close();
  320. }
  321. catch (Exception ex)
  322. {
  323. // MessageBox.Show(ex.Message);
  324. }
  325. }
  326. #endregion
  327.  
  328. #region 获得ftp上文件大小
  329. /// <summary>
  330. /// 获得ftp上文件大小
  331. /// </summary>
  332. /// <param name="filename"></param>
  333. /// <returns></returns>
  334. public long GetFileSize(string filename)
  335. {
  336. long fileSize = ;
  337. filename = filename.Replace("\\", "/");
  338. try
  339. {
  340. // FileInfo fileInf = new FileInfo(filename);
  341. //string uri1 = "ftp://" + ftpServerIP + "/" + fileInf.Name;
  342. // string uri = filename;
  343. string uri = "ftp://" + filename;
  344. Connect(uri);//连接
  345. reqFTP.Method = WebRequestMethods.Ftp.GetFileSize;
  346. FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
  347. fileSize = response.ContentLength;
  348. response.Close();
  349. }
  350. catch (Exception ex)
  351. {
  352. // MessageBox.Show(ex.Message);
  353. }
  354. return fileSize;
  355. }
  356. #endregion
  357.  
  358. #region ftp上文件改名
  359. /// <summary>
  360. /// ftp上文件改名
  361. /// </summary>
  362. /// <param name="currentFilename"></param>
  363. /// <param name="newFilename"></param>
  364. public void Rename(string currentFilename, string newFilename)
  365. {
  366. try
  367. {
  368. FileInfo fileInf = new FileInfo(currentFilename);
  369. string uri = "ftp://" + ftpServerIP + "/" + fileInf.Name;
  370. Connect(uri);//连接
  371. reqFTP.Method = WebRequestMethods.Ftp.Rename;
  372. reqFTP.RenameTo = newFilename;
  373. FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
  374. //Stream ftpStream = response.GetResponseStream();
  375. //ftpStream.Close();
  376. response.Close();
  377. }
  378. catch (Exception ex)
  379. {
  380. // MessageBox.Show(ex.Message);
  381. }
  382. }
  383. #endregion
  384.  
  385. #region 获得文件明晰
  386. /// <summary>
  387. /// 获得文件明晰
  388. /// </summary>
  389. /// <returns></returns>
  390. public string[] GetFilesDetailList()
  391. {
  392. return GetFileList("ftp://" + ftpServerIP + "/", WebRequestMethods.Ftp.ListDirectoryDetails);
  393. }
  394. /// <summary>
  395. /// 获得文件明晰
  396. /// </summary>
  397. /// <param name="path"></param>
  398. /// <returns></returns>
  399. public string[] GetFilesDetailList(string path)
  400. {
  401. path = path.Replace("\\", "/");
  402. return GetFileList("ftp://" + path, WebRequestMethods.Ftp.ListDirectoryDetails);
  403. }
  404. #endregion
  405. }

在webconfig里面 直接配置如下就能使用了。。直接源码提供。。O(∩_∩)O哈哈~

  1. <add key="FileSaveBasePath" value="D:\web\Content" />
  2. <add key="FtpUpload" value="false"/>
  3. <add key="FtpServerIP" value="127.0.0.1"/>
  4. <add key="FtpUserId" value="settingftp"/>
  5. <add key="FtpPassword" value="/psw"/>
  6. <add key="FtpHtmlBasePath" value=""/>
  7. <add key="FtpFileBasePath" value="test"/>

  

分布式部署网站---文件系统的存储--ftp上传图片到指定文件服务器的更多相关文章

  1. 网站文件系统发展&&分布式文件系统fastDFS

    网站文件系统发展 1.单机时代的图片服务器架构 初创时期由于时间紧迫,开发人员水平也很有限等原因.所以通常就直接在website文件所在的目录下,建立1个upload子目录,用于保存用户上传的图片文件 ...

  2. AIX文件系统和存储部署(转)

    文件系统和存储部署 文件系统的管理是AIX存储结构中的最后一环.定义完lv后,可采用如下两种方式使用lv: a.作为裸设备(raw)使用,一般是数据库型的应用 b.在lv上定义文件系统,并提供文件和数 ...

  3. Hadoop基础-HDFS分布式文件系统的存储

    Hadoop基础-HDFS分布式文件系统的存储 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.HDFS数据块 1>.磁盘中的数据块 每个磁盘都有默认的数据块大小,这个磁盘 ...

  4. 白嫖永久免费云服务器教程,永久免费虚拟主机、永久免费云数据库、搭建FTP服务器、服务器安装Linux / windows操作系统、服务器部署网站、宝塔一键部署多网站、独立ip、永久国内高速云服务器

    一.准备工作 1. 注册账号 声明:切记不可用服务器做违法的事情 申请地址:https://www.sanfengyun.com/ 图文教程地址:https://www.cnblogs.com/zwn ...

  5. Hadoop生态圈-flume日志收集工具完全分布式部署

    Hadoop生态圈-flume日志收集工具完全分布式部署 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.   目前为止,Hadoop的一个主流应用就是对于大规模web日志的分析和处理 ...

  6. Zabbix监控和分布式部署实施方案

    最近在研究Zabbix监控,由于机房分布在多个城市,因此采用zabbix proxy做为监控方案,在每 个节点部署zabbix proxy,由zabbix proxy收集agentd数据,然后将采集到 ...

  7. Web分布式部署,跨应用程序Forms身份验证的集成方案

    最近一个项目要求进行分布式部署.保证在双十一期间系统的正常运行,虽然该系统平时访问量不是很大,但是基于业务需要,必须在至少两台服务器上部署. 该系统需要登录后才可以使用,首先需要解决分布式部署的用户状 ...

  8. nginx+memcached+ftp上传图片+iis

    nginx+memcached+ftp上传图片+iis 自毕业以来,一直在现在公司做订餐系统的开发,那会儿没有口碑,没有饿了么,更别说美团外卖,百度外卖了...因为规模都比较小,都是一个服务器包含数据 ...

  9. Hadoop 2.6.0分布式部署參考手冊

    Hadoop 2.6.0分布式部署參考手冊 关于本參考手冊的word文档.能够到例如以下地址下载:http://download.csdn.net/detail/u012875880/8291493 ...

随机推荐

  1. javascript小程序——用嵌套循环来输出乘法口诀表

    在学习javascript过程中,一开始接触循环语句时一般拿乘法口诀表来练手,这里我将自己的练习贴在这里,希望能给和我一样的初学者些许帮助,也希望大神们能够不吝指教. 首先,来看一下乘法口诀表是什么样 ...

  2. 在.NET Core控制台应用程序中使用强类型配置

    想象一下,你写一个控制台应用程序,你想要从配置文件中以强类型方式读取配置. .NET Core 可以帮助我们解决. 通常我会在ASP.NET Core MVC中演示,但简单起见,只在控制台应用程序中演 ...

  3. 什么是Git?

    其实我在写这篇随笔的时候连Git是什么都不知道,只是听说过,也注册了一个GitHub的账号,但并不会玩. 我也是查看了半天的网页才明白一个大概,但我觉得以后肯定会经常用到它. 简单的来说, Git 是 ...

  4. UVALive 7045 Last Defence

    ProblemK. Last Defence Description Given two integersA and B. Sequence S is defined as follow: • S0 ...

  5. ERP免费模拟上线

    为了让更多中小企业在应用管理软件之前可以评估企业执行力和规避实施风险,普实在云端部署了AIO5的试用环境,免费供大家导入实际数据进行学习和测试.因资源有限,申请要求如下: 1.填写申请信息并加盖公章: ...

  6. Debian/Ubuntu安装Oracle客户端TNS

    本文作为新手在Linux上部署Java程序的必经之路的Oracle客户端配置,请高手绕道. 确定服务器版本 首选确定你的Oracle服务器版本,以便下载相应的客户端.查看的sql如下: select ...

  7. 使用mysql_Front链接mysql,出现警告access denied for user ''@'localhost'

    刚刚安装好的mysql5.7,想来使用工具方便一下,却一直有报这个错误: 最后找出原因:我给root用户设置的密码神不知鬼不觉的消失了,无奈, 解决办法一: cmd->mysql -h loca ...

  8. SSH登录与增删改查demo详解+源代码

    点击下载,测试绝对可用SSH整合框架登录加增删改查demo 下载地址:http://download.csdn.net/detail/qq_33599520/9784679   一.框架概述 spri ...

  9. 腾讯QQ会员技术团队:以手机QQ会员H5加速为例,为你揭开sonic技术内幕

    目前移动端越多越多的网页开始H5化,一方面可以减少安装包体积,另一方面也方便运营.但是相对于原生界面而言,H5的慢速问题一定被大家所诟病,针对这个问题,目前手Q存在几种方案,最常见的便是离线包方案,但 ...

  10. flask-mail发送QQ邮件代码示例(亲测可行)

    from flask import Flask from flask_mail import Mail, Message app = Flask(__name__) app.config.update ...