效果:

描述:

本事例是为解决在上传或下载文件时避免将路径暴露在外。在上传时将路径进行加密保存到DataTable或数据库中,在下载是再读取DataTable中加密数据进行解密下载。

代码:

【前台代码】

 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileUpload.aspx.cs" Inherits="FilePathEncrypt.FileUpload" %>

 <!DOCTYPE html>

 <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title> </head>
<body>
<%--<form id="form1" runat="server" name="formFile" method="post" action="/FileUpload.aspx" target="frameFile" enctype="multipart/form-data">--%>
<form id="form1" runat="server">
<div>
<%--<input type="text" id="textID" name="txtName" />--%>
<%--<input type="file" id="fileUp" name="fileUp" />--%>&nbsp;&nbsp;<%--<input type="submit" value="确认上传" />--%>
<%--<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>--%>
<asp:FileUpload ID="FileUpload1" runat="server" />&nbsp;&nbsp;<asp:Button ID="Button1" runat="server" Text="确认上传" OnClick="Button1_Click" /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Height="132px" Width="251px" CellPadding="4" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" />
<asp:BoundField DataField="FileName" HeaderText="名称" />
<asp:BoundField DataField="FileType" HeaderText="类型" />
<asp:BoundField DataField="FilePath_Security" HeaderText="路径加密" />
<asp:TemplateField HeaderText="下载">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" NavigateUrl='<%# Eval("FilePath_Security") %>' runat="server">下载</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</div>
</form>
<iframe id="frameFile" name="frameFile" style="display: none;"></iframe>
</body>
</html>

【后台代码】

 using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WooBase.Common; namespace FilePathEncrypt
{
public partial class FileUpload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ DataTable dt = new DataTable();
dt = NewTable(); GridView1.DataSource = dt;
GridView1.DataBind();
} /// <summary>
/// 构建DataTable
/// </summary>
/// <returns></returns>
public DataTable NewTable()
{
DataTable dt = new DataTable();
dt.TableName = "SaveData";
DataColumn col = new DataColumn("ID", typeof(Int32));
col.AutoIncrement = true;
col.AutoIncrementSeed = ;
col.AutoIncrementStep = ;
dt.Columns.Add(col);
dt.Columns.Add("FileName", typeof(String));
dt.Columns.Add("FileType", typeof(String));
dt.Columns.Add("FilePath_Security", typeof(String)); DataRow dr = dt.NewRow();
dr["FileName"] = "青苹果.jpg";
dr["FileType"] = ".jpg";
dr["FilePath_Security"] = "DownLoad.aspx?cmd=6A6B41446F6E395177457A70705541344D563657736B5351417447445441485A633348326E55347A2F5854656751764C4E4A546172773D3D";
dt.Rows.Add(dr);
DataRow dr1 = dt.NewRow();
dr1["FileName"] = "青苹果.txt";
dr1["FileType"] = ".txt";
dr1["FilePath_Security"] = "DownLoad.aspx?cmd=6A6B41446F6E395177457A70705541344D563657736B5351417447445441485A633348326E55347A2F5854656751764C4E4A546172773D3D";
dt.Rows.Add(dr1); return dt;
} protected void Button1_Click(object sender, EventArgs e)
{
string FullName = FileUpload1.PostedFile.FileName;
if (!string.IsNullOrEmpty(FullName))
{
FileInfo fi = new FileInfo(FullName);
string name = fi.Name;//获取word名称
string type = fi.Extension;//获取word类型
string SavePath = Server.MapPath("UploadFile\\");//word保存到文件夹下
if (!Directory.Exists(SavePath)) //判断文件夹是否存在,如果不存在则创建
{
Directory.CreateDirectory(SavePath);
}
this.FileUpload1.PostedFile.SaveAs(SavePath + "\\" + name + ".wdata");//保存路径
string SecurityPath = setPath("UploadFile\\" + name + ".wdata");//加密 DataTable dt = new DataTable();
dt = NewTable();
if (name != "")
{
DataRow dr = dt.NewRow();
dr["FileName"] = name;
dr["FileType"] = type;
dr["FilePath_Security"] = SecurityPath;
dt.Rows.Add(dr);
}
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
Response.Write("<script>alert('请选择文件');</script>");
}
}
/// <summary>
/// 加密路径
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static string setPath(string path)
{
string SetPath = "";
try
{
SetPath = "DownLoad.aspx?cmd=" + Security.Encrypt_Des2(path) + "\"";
return SetPath;
}
catch (Exception ex)
{
throw ex;
} }
}
}

【后台加密函数代码】

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text;
using System.Security.Cryptography; namespace WooBase.Common
{
public class Security
{
// DES 的加密方法 。
// 私钥加密 / 对称算法 。
public static string Encrypt_Des(string cleanString)
{
//.NET 框架提供的对称加密类需要一个密钥和一个新的 IV 来加密和解密数据。
//每当使用默认的构造函数创建其中一个托管对称加密类的新实例时,就会自动创建新的密钥和 IV
//DES 使用 64 位密钥、64 位块来加密和解密数据。每个数据块迭代 16 次以生成加密文本。
//初始化向量(IV) 用来第一次对数据块进行加密 。
byte[] KEY_64 = { , , , , , , , }; // 指定的 Key
byte[] IV_64 = { , , , , , , , }; // 初始化向量(IV)
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, provider.CreateEncryptor(KEY_64, IV_64), CryptoStreamMode.Write);
StreamWriter sw = new StreamWriter(cs);
sw.Write(cleanString);
sw.Flush();
cs.FlushFinalBlock();
ms.Flush();
return Convert.ToBase64String(ms.GetBuffer(), , int.Parse((ms.Length.ToString())));
} public static string Encrypt_Des2(string cleanString)
{
string result = string.Empty;
byte[] KEY_64 = { , , , , , , , }; // 指定的 Key
byte[] IV_64 = { , , , , , , , }; // 初始化向量(IV)
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, provider.CreateEncryptor(KEY_64, IV_64), CryptoStreamMode.Write);
StreamWriter sw = new StreamWriter(cs);
sw.Write(cleanString);
sw.Flush();
cs.FlushFinalBlock();
ms.Flush();
string tmpS = Convert.ToBase64String(ms.GetBuffer(), , int.Parse((ms.Length.ToString())));
byte[] bTemp = System.Text.Encoding.Default.GetBytes(tmpS);
for (int i = ; i < bTemp.Length; i++)
{
result += bTemp[i].ToString("X");
}
return result;
} // DES 的解密方法 。
// 私钥加密 / 对称算法 。
public static string Decrypt_Des(string encryptedString)
{
byte[] KEY_64 = { , , , , , , , };
byte[] IV_64 = { , , , , , , , };
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
byte[] buffer = Convert.FromBase64String(encryptedString);
MemoryStream ms = new MemoryStream(buffer);
CryptoStream cs = new CryptoStream(ms, provider.CreateDecryptor(KEY_64, IV_64), CryptoStreamMode.Read);
StreamReader sr = new StreamReader(cs);
return sr.ReadToEnd(); } public static string Decrypt_Des2(string encryptedString)
{
byte[] b = new byte[encryptedString.Length / ];
for (int i = ; i < encryptedString.Length / ; i++)
{
string strTemp = encryptedString.Substring(i * , );
b[i] = Convert.ToByte(strTemp, );
}
string str = System.Text.Encoding.Default.GetString(b); byte[] KEY_64 = { , , , , , , , };
byte[] IV_64 = { , , , , , , , };
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
byte[] buffer = Convert.FromBase64String(str);
MemoryStream ms = new MemoryStream(buffer);
CryptoStream cs = new CryptoStream(ms, provider.CreateDecryptor(KEY_64, IV_64), CryptoStreamMode.Read);
StreamReader sr = new StreamReader(cs);
return sr.ReadToEnd(); }
}
}

【后台下载类代码】

 using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Woo.Utility;
using WooBase.Common; namespace FilePathEncrypt
{
public partial class DownLoad : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//访问此页进行解密下载
//例如:AjaxPage/WooCommon/DownLoad.aspx?cmd=42544F4A692B5775664E4C45316E3437366B2F553761304E6A52644A32734E76697470494C726E4D766C4662795751322B6737375875504D73644331556F4A2F6C2F526C39423073365435492F33714D3755657536484868496B3275395A745059464C72776E705376666B4D7330504F5A30476F454C3061697541784B556471724B30777479577A382F453D var cmd = PageUtility.GetRequestString("cmd");
if (!string.IsNullOrEmpty(cmd))
{
cmd = cmd.Replace("\"", "").Trim();
cmd = Security.Decrypt_Des2(cmd).ToLower();
cmd = cmd.Replace("/", "\\").Replace("\"", "");
string dir = HttpContext.Current.Request.PhysicalApplicationPath;
if (File.Exists(dir + cmd))
{
int finded = (dir + cmd).LastIndexOf(".wdata");
string FileName = (dir + cmd).Remove(finded); string ext = System.IO.Path.GetExtension(FileName);
string fname = System.IO.Path.GetFileName(FileName); HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fname, System.Text.Encoding.GetEncoding("UTF-8")));
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
HttpContext.Current.Response.ContentType = GetContentType(ext);
HttpContext.Current.Response.WriteFile(FileName + ".wdata");
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End(); HttpContext.Current.Response.Redirect(FileName + ".wdata");
}
}
else
{
var cmdtwo = PageUtility.GetRequestString("noEncryptCmd");
if (!string.IsNullOrEmpty(cmdtwo))
{
cmdtwo = cmdtwo.Replace("\"", "").Trim();
cmdtwo = cmdtwo.Replace("/", "\\").Replace("\"", "");
string dir = HttpContext.Current.Request.PhysicalApplicationPath;
if (File.Exists(dir + cmdtwo))
{
int finded = (dir + cmdtwo).LastIndexOf(".wdata");
string FileName = (dir + cmdtwo).Remove(finded); string ext = System.IO.Path.GetExtension(FileName);
string fname = System.IO.Path.GetFileName(FileName); HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fname, System.Text.Encoding.GetEncoding("UTF-8")));
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
HttpContext.Current.Response.ContentType = GetContentType(ext);
HttpContext.Current.Response.WriteFile(FileName + ".wdata");
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End(); HttpContext.Current.Response.Redirect(FileName + ".wdata");
}
}
}
} private string GetContentType(string ext)
{
switch (ext.ToLower().Trim('.'))
{ //"application/vnd.openxmlformats-officedocument.presentationml.presentation" (for . files)
//"" (for .ppsx files)
//"" (for . files)
//"" (for . files)
//"" (for . files) case "docx": return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
case "dotx": return "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
case "pptx": return "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
case "potx": return "application/vnd.openxmlformats-officedocument.presentationml.template";
case "xlsx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
case "xltx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
case "accdb":
case "accde":
case "accdt":
return "application/msaccess";
case "mdb": return "application/x-msaccess";
case "ez": return "application/andrew-inset";
case "hqx": return "application/mac-binhex40";
case "cpt": return "application/mac-compactpro";
case "doc": return "application/msword";
case "bin": return "application/octet-stream";
case "dms": return "application/octet-stream";
case "lha": return "application/octet-stream";
case "lzh": return "application/octet-stream";
case "exe": return "application/octet-stream";
case "class": return "application/octet-stream";
case "so": return "application/octet-stream";
case "dll": return "application/octet-stream";
case "oda": return "application/oda";
case "pdf": return "application/pdf";
case "ai": return "application/postscript";
case "eps": return "application/postscript";
case "ps": return "application/postscript";
case "smi": return "application/smil";
case "smil": return "application/smil";
case "mif": return "application/vnd.mif";
case "xls": return "application/vnd.ms-excel";
case "ppt": return "application/vnd.ms-powerpoint";
case "wbxml": return "application/vnd.wap.wbxml";
case "wmlc": return "application/vnd.wap.wmlc";
case "wmlsc": return "application/vnd.wap.wmlscriptc";
case "bcpio": return "application/x-bcpio";
case "vcd": return "application/x-cdlink";
case "pgn": return "application/x-chess-pgn";
case "cpio": return "application/x-cpio";
case "csh": return "application/x-csh";
case "dcr": return "application/x-director";
case "dir": return "application/x-director";
case "dxr": return "application/x-director";
case "dvi": return "application/x-dvi";
case "spl": return "application/x-futuresplash";
case "gtar": return "application/x-gtar";
case "hdf": return "application/x-hdf";
case "js": return "application/x-javascript";
case "skp": return "application/x-koan";
case "skd": return "application/x-koan";
case "skt": return "application/x-koan";
case "skm": return "application/x-koan";
case "latex": return "application/x-latex";
case "nc": return "application/x-netcdf";
case "cdf": return "application/x-netcdf";
case "sh": return "application/x-sh";
case "shar": return "application/x-shar";
case "swf": return "application/x-shockwave-flash";
case "sit": return "application/x-stuffit";
case "sv4cpio": return "application/x-sv4cpio";
case "sv4crc": return "application/x-sv4crc";
case "tar": return "application/x-tar";
case "tcl": return "application/x-tcl";
case "tex": return "application/x-tex";
case "texinfo": return "application/x-texinfo";
case "texi": return "application/x-texinfo";
case "t": return "application/x-troff";
case "tr": return "application/x-troff";
case "roff": return "application/x-troff";
case "man": return "application/x-troff-man";
case "me": return "application/x-troff-me";
case "ms": return "application/x-troff-ms";
case "ustar": return "application/x-ustar";
case "src": return "application/x-wais-source";
case "xhtml": return "application/xhtml+xml";
case "xht": return "application/xhtml+xml";
case "zip": return "application/zip";
case "au": return "audio/basic";
case "snd": return "audio/basic";
case "mid": return "audio/midi";
case "midi": return "audio/midi";
case "kar": return "audio/midi";
case "mpga": return "audio/mpeg";
case "mp2": return "audio/mpeg";
case "mp3": return "audio/mpeg";
case "aif": return "audio/x-aiff";
case "aiff": return "audio/x-aiff";
case "aifc": return "audio/x-aiff";
case "m3u": return "audio/x-mpegurl";
case "ram": return "audio/x-pn-realaudio";
case "rm": return "audio/x-pn-realaudio";
case "rpm": return "audio/x-pn-realaudio-plugin";
case "ra": return "audio/x-realaudio";
case "wav": return "audio/x-wav";
case "pdb": return "chemical/x-pdb";
case "xyz": return "chemical/x-xyz";
case "bmp": return "image/bmp";
case "gif": return "image/gif";
case "ief": return "image/ief";
case "jpeg": return "image/jpeg";
case "jpg": return "image/jpeg";
case "jpe": return "image/jpeg";
case "png": return "image/png";
case "tiff": return "image/tiff";
case "tif": return "image/tiff";
case "djvu": return "image/vnd.djvu";
case "djv": return "image/vnd.djvu";
case "wbmp": return "image/vnd.wap.wbmp";
case "ras": return "image/x-cmu-raster";
case "pnm": return "image/x-portable-anymap";
case "pbm": return "image/x-portable-bitmap";
case "pgm": return "image/x-portable-graymap";
case "ppm": return "image/x-portable-pixmap";
case "rgb": return "image/x-rgb";
case "xbm": return "image/x-xbitmap";
case "xpm": return "image/x-xpixmap";
case "xwd": return "image/x-xwindowdump";
case "igs": return "model/iges";
case "iges": return "model/iges";
case "msh": return "model/mesh";
case "mesh": return "model/mesh";
case "silo": return "model/mesh";
case "wrl": return "model/vrml";
case "vrml": return "model/vrml";
case "css": return "text/css";
case "html": return "text/html";
case "htm": return "text/html";
case "asc": return "text/plain";
case "txt": return "text/plain";
case "rtx": return "text/richtext";
case "rtf": return "text/rtf";
case "sgml": return "text/sgml";
case "sgm": return "text/sgml";
case "tsv": return "text/tab-separated-values";
case "wml": return "text/vnd.wap.wml";
case "wmls": return "text/vnd.wap.wmlscript";
case "etx": return "text/x-setext";
case "xsl": return "text/xml";
case "xml": return "text/xml";
case "mpeg": return "video/mpeg";
case "mpg": return "video/mpeg";
case "mpe": return "video/mpeg";
case "qt": return "video/quicktime";
case "mov": return "video/quicktime";
case "mxu": return "video/vnd.mpegurl";
case "avi": return "video/x-msvideo";
case "movie": return "video/x-sgi-movie";
case "ice": return "x-conference/x-cooltalk";
default:
return "application/octet-stream";
} }
}
}

Demo下载:

http://files.cnblogs.com/files/xinchun/pathEncrypt.zip

点滴积累【C#】---对上传文件的路径进行加密,以免将路径暴露在浏览器上,避免一些安全隐患!的更多相关文章

  1. VFS 上传文件到sftp 报错 包含中文路径 或者中文文件名称

    之前用Apache commons-vfs工具进行ftp操作(FTP服务器是 FileZilla Server) 上传本地文件 到 ftp服务器上,如果文件名称 包含 中文 报错 org.apache ...

  2. Django学习——ajax发送其他请求、上传文件(ajax和form两种方式)、ajax上传json格式、 Django内置序列化(了解)、分页器的使用

    1 ajax发送其他请求 1 写在form表单 submit和button会触发提交 <form action=""> </form> 注释 2 使用inp ...

  3. 【点滴积累,厚积薄发】windows schedule task中.exe程序的路径问题等问题总结

    1.在发布ReportMgmt的Job时遇到一个路径问题,代码如下: doc.Load(@"Configuration\Business\business.config");   ...

  4. node.js+react全栈实践-Form中按照指定路径上传文件并

    书接上回,讲到“使用同一个新增弹框”中有未解决的问题,比如复杂的字段,文件,图片上传,这一篇就解决文件上传的问题.这里的场景是在新增弹出框中要上传一个图片,并且这个上传组件放在一个Form中,和其他文 ...

  5. spring mvc CommonsMultipartResolver上传文件异常处理

    近期已经上线的项目出现了一个异常 严重: Servlet.service() for servlet JeeCmsAdmin threw exception org.apache.commons.fi ...

  6. C# Web Api 上传文件

    一. 使用默认方法上传文件: 1.Action: /// <summary> /// 上传文件 使用上传后的默认文件名称 /// 默认名称是BodyPart_XXXXXX,BodyPart ...

  7. javaweb-番外篇-Commons-FileUpload组件上传文件

    一.Commons-FileUpload简介 Commons-FileUpload组件 Commons是Apache开放源代码组织的一个Java子项目,其中的FileUpload是用来处理HTTP文件 ...

  8. 从零开始学安全(四十)●上传文件MIME类型绕过漏洞防御

    MIME检测原理 服务端MIME类型检测是通过检查http包的Content-Type字段中的值来判断上传文件是否合法的. php示例代码: if($_FILES['userfile']['type' ...

  9. Android 上传文件,图片。以及服务器端接收相关。

    前面一篇文章写了实现照相功能的一个例子,其实那个实现效果是个略缩图.要查看全图就要先指定照片的存放路径.以后我会修改那个文章.今天先说下图片,文件等上传的实现.接着拿照片说事,光照完了不行还得往服务器 ...

随机推荐

  1. 将WPF版的弹幕播放器给优化了一下

    年前较闲的时候研究了一下WPF的性能优化,练手的时将之前写的弹幕播放器给重新写了一下.年前的时间不大够,没有写完,这两天接着弄了一下,基本上弄得差不多了. 主要重写了底层的渲染算法,优化后效果还是非常 ...

  2. 基于指定文本的百度地图poi城市检索的使用(思路最重要)

    (转载请注明出处哦)具体的百度地图权限和apikey配置以及基础地图的配置不叙述,百度地图定位可以看这个链接的http://blog.csdn.net/heweigzf/article/details ...

  3. iOS:创建单例对象的两种方式

    单例模式:创建单例对象的两种方式 方式一:iOS4版本之前      static SingleClassManager *singleManager = nil;      +(SingleClas ...

  4. xss的高级利用

    以往对XSS的利用大多数都是针对于挂马,钓鱼,盗cookie等,这些方式并没有真正发挥到XSS的作用,因为很少人能了解XSS的实质,会话劫持,浏览器劫持,XSS能做到的东西远远超乎我们的想象. 一 X ...

  5. wireshark在windows下无法抓取localhost数据包

    在调试SSL时要抓包,通过tcpview和minisniffer等工具明明看到tcp连接已经建立并开始收发数据了,但wireshark却总是无法抓到相应的数据包. 今天早上,HQ的高工告诉我“wire ...

  6. mysql 比较隐秘的问题

    2017-11-13 13:47:27:DEBUG DubboServerHandler-192.168.30.114:20990-thread-5 com.yryz.qshop.modules.in ...

  7. 一条长为L的绳子,一面靠墙,另外三边组成矩形,问此矩形最大面积能是多少?

    靠墙的两边设为x,墙的对边设为y,有2x+y=L; 则y=L-2x, 矩形面积函数为xy=x(L-2x)=-2x2+xL,即f(x)=-2x2+xL 这时就是求二次函数的极值问题了. 按二次函数y=a ...

  8. 优化SQL Server的内存占用之执行缓存

    在论坛上常见有朋友抱怨,说SQL Server太吃内存了.这里笔者根据经验简单介绍一下内存相关的调优知识   首先说明一下SQL Server内存占用由哪几部分组成.SQL Server占用的内存主要 ...

  9. iOS 使用 AVCaptureVideoDataOutputSampleBufferDelegate获取实时拍照的视频流

    iOS 使用 AVCaptureVideoDataOutputSampleBufferDelegate获取实时拍照的视频流 可用于实时视频聊天 实时视频远程监控 #import <AVFound ...

  10. org.w3c.dom(java dom)解析XML文档

    位于org.w3c.dom操作XML会比较简单,就是将XML看做是一颗树,DOM就是对这颗树的一个数据结构的描述,但对大型XML文件效果可能会不理想 首先来了解点Java DOM 的 API:1.解析 ...