//////////////////
// Helper Funcs //
//////////////////
// used to find the Automation object name
function getDomDocumentPrefix() {
if (getDomDocumentPrefix.prefix)
return getDomDocumentPrefix.prefix;
var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
var o;
for (var i = 0; i < prefixes.length; i++) {
try {
// try to create the objects
o = new ActiveXObject(prefixes[i] + ".DomDocument");
return getDomDocumentPrefix.prefix = prefixes[i];
}
catch (ex) {};
}
throw new Error("Could not find an installed XML parser");
}
function getXmlHttpPrefix() {
if (getXmlHttpPrefix.prefix)
return getXmlHttpPrefix.prefix;
var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
var o;
for (var i = 0; i < prefixes.length; i++) {
try {
// try to create the objects
o = new ActiveXObject(prefixes[i] + ".XmlHttp");
return getXmlHttpPrefix.prefix = prefixes[i];
}
catch (ex) {};
}
throw new Error("Could not find an installed XMLHttp object");
}
//////////////////////////
// Start the Real Funcs //
//////////////////////////
// XmlHttp factory
function XmlHttp() {}
XmlHttp.create = function () {
try {
// NS & MOZ
if (window.XMLHttpRequest) {
var req = new XMLHttpRequest();
// some versions of Moz do not support the readyState property
// and the onreadystate event so we patch it!
if (req.readyState == null) {
req.readyState = 1;
req.addEventListener("load", function () {
req.readyState = 4;
if (typeof req.onreadystatechange == "function")
req.onreadystatechange();
}, false);
}
return req;
}
// IE
if (window.ActiveXObject) {
return new ActiveXObject(getXmlHttpPrefix() + ".XmlHttp");
}
}
catch (ex) {}
// Fail
throw new Error("Your browser does not support XmlHttp objects");
};
// XmlDocument factory
function XmlDocument() {}
XmlDocument.create = function () {
try {
// DOM2, MOZ & NS
if (document.implementation && document.implementation.createDocument) {
var doc = document.implementation.createDocument("", "", null);
// some versions of Moz do not support the readyState property
// and the onreadystate event so we patch it!
if (doc.readyState == null) {
doc.readyState = 1;
doc.addEventListener("load", function () {
doc.readyState = 4;
if (typeof doc.onreadystatechange == "function")
doc.onreadystatechange();
}, false);
}
return doc;
}
if (window.ActiveXObject)
return new ActiveXObject(getDomDocumentPrefix() + ".DomDocument");
}
catch (ex) {}
throw new Error("Your browser does not support XmlDocument objects");
};
// Create the loadXML method and xml getter for Mozilla
if (window.DOMParser &&
window.XMLSerializer &&
window.Node && Node.prototype && Node.prototype.__defineGetter__) {
// XMLDocument did not extend the Document interface in some versions
// of Mozilla. Extend both!
//XMLDocument.prototype.loadXML =
Document.prototype.loadXML = function (s) {
// parse the string to a new doc
var doc2 = (new DOMParser()).parseFromString(s, "text/xml");
// remove all initial children
while (this.hasChildNodes())
this.removeChild(this.lastChild);
// insert and import nodes
for (var i = 0; i < doc2.childNodes.length; i++) {
this.appendChild(this.importNode(doc2.childNodes[i], true));
}
};
/*
* xml getter
*
* This serializes the DOM tree to an XML String
*
* Usage: var sXml = oNode.xml
*
*/
Document.prototype.__defineGetter__("xml", function () {
return (new XMLSerializer()).serializeToString(this);
});
}
/*
* xmlHttp Pool
*
* userage: var xmlhttpObj = XmlHttpPool.pick()
*/
var XmlHttpPoolArr = new Array();
var XmlHttpPoolSize = 100;
var XHPCurrentAvailableID = 0;
function XmlHttpPool() {}
XmlHttpPool.pick = function() {
var pos = XHPCurrentAvailableID;
XmlHttpPoolArr[pos] = XmlHttp.create();
XHPCurrentAvailableID >= (XmlHttpPoolSize-1) ? 0 : XHPCurrentAvailableID++
return XmlHttpPoolArr[pos];
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于asp.net大文件上传源代码
共25个文件
cs:8个
resx:4个
aspx:3个
需积分: 0 72 下载量 20 浏览量
2008-09-02
15:48:32
上传
评论 2
收藏 29KB RAR 举报
温馨提示
大文件上传源代码,可以试试,无组件的.宝玉写的
资源推荐
资源详情
资源评论
收起资源包目录
openlabupload.rar (25个子文件)
Upload
Components.csproj.user 2KB
Progress.cs 2KB
HttpUploadModule.cs 8KB
Components.csproj 4KB
AssemblyInfo.cs 2KB
OpenlabUpload.sln 1KB
Web
WebForm1.aspx.cs 2KB
Global.asax.cs 1KB
Global.asax 73B
Default.aspx.resx 5KB
bin
Upload.dll 20KB
Openlab.Web.Upload.dll 20KB
Progress.aspx.resx 5KB
Web.config 4KB
Upload.csproj 6KB
WebForm1.aspx 1KB
xmlLib.js 4KB
Default.aspx 4KB
Upload.csproj.webinfo 110B
Default.aspx.cs 2KB
Progress.aspx 108B
Progress.aspx.cs 2KB
WebForm1.aspx.resx 5KB
Global.asax.resx 2KB
AssemblyInfo.cs 2KB
共 25 条
- 1
资源评论
xbbxbbxbb
- 粉丝: 2
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功