lodop打印收费小票
//收费系统打印机功能:收费/退费,需要使用到lodop
var LODOP;//打印机
$(function () {
//初始化
$("body").append('<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed></object>'); LODOP = getLodop();
}); //检测是否安装了打印插件
function CheckLodop()
{
var oOBJECT = document.getElementById('LODOP_OB'), oEMBED = document.getElementById('LODOP_EM');
var LODOP = oEMBED;
try {
var isIE = (navigator.userAgent.indexOf('MSIE') >= 0) || (navigator.userAgent.indexOf('Trident') >= 0);
var is64IE = isIE && (navigator.userAgent.indexOf('x64') >= 0);
if (isIE) LODOP = oOBJECT;
if ((LODOP == null) || (typeof (LODOP.VERSION) == "undefined")) {
return false;
} else
if (LODOP.VERSION < "6.1.6.1") {
return false;
}
return true;
} catch (err) {
return false;
}
} function getLodop() {
var oOBJECT = document.getElementById('LODOP_OB'), oEMBED = document.getElementById('LODOP_EM');
/**************************
本函数根据浏览器类型决定采用哪个对象作为控件实例:
IE系列、IE内核系列的浏览器采用oOBJECT,
其它浏览器(Firefox系列、Chrome系列、Opera系列、Safari系列等)采用oEMBED,
对于64位浏览器指向64位的安装程序install_lodop64.exe。
**************************/
var strHtmInstall = "打印控件未安装!点击这里<a href='/patch/install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。";
var strHtmUpdate = "打印控件需要升级!点击这里<a href='/patch/install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。";
var strHtm64_Install = "打印控件未安装!点击这里<a href='/patch/install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。";
var strHtm64_Update = "打印控件需要升级!点击这里<a href='/patch/install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。";
var strHtmFireFox = "注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它。";
var LODOP = oEMBED;
try {
var isIE = (navigator.userAgent.indexOf('MSIE') >= 0) || (navigator.userAgent.indexOf('Trident') >= 0);
var is64IE = isIE && (navigator.userAgent.indexOf('x64') >= 0);
var errhtml = '';
if (isIE) LODOP = oOBJECT;
if ((LODOP == null) || (typeof (LODOP.VERSION) == "undefined")) {
if (navigator.userAgent.indexOf('Firefox') >= 0)
{
errhtml = strHtmFireFox
}
if (is64IE) {
errhtml = strHtm64_Install;
}
else if (isIE) {
errhtml = strHtmInstall;
}
else
{
errhtml = strHtmInstall;
}
ShowPrintErr(errhtml);
return LODOP;
} else {
if (LODOP.VERSION < "6.1.6.1") {
if (is64IE) {
errhtml = strHtm64_Update;
}
else if (isIE) {
errhtml = strHtmUpdate;
}
else {
errhtml = strHtmUpdate;
}
ShowPrintErr(errhtml);
return LODOP;
}
}
//=====如下空白位置适合调用统一功能:===== //=======================================
return LODOP;
} catch (err) {
if (is64IE)
{
errhtml = "Error:" + strHtm64_Install;
}
else
{
errhtml = "Error:" + strHtmInstall;
}
ShowPrintErr(errhtml);
return LODOP;
}
return LODOP;
} function ShowPrintErr(h)
{
if (h)
{
h = "<p>" + h;
h += " <span id='az_close' style='cursor:pointer;display:inline-block;position:absolute;right:0;' title='点击关闭'>X</span></p>";
$(".az_remind").html(h).fadeIn(2000);
$("#az_close").click(function () {
$(".az_remind").fadeOut(2000);
});
setTimeout(function () { $(".az_remind").fadeOut(2000); }, 5000);
}
} (function ($) {
function PrintBase(printObj) {
this.nf = { FontName: '宋体', FontSize: 9 };
this.hf = { FontName: '宋体', FontSize: 20 };
this.printObj = printObj;
this.printBegin = function () {
LODOP.PRINT_INIT("票据" + Math.random());
LODOP.SET_PRINTER_INDEXA(printObj.PrintSet.printerName);
LODOP.SET_PRINT_MODE("POS_BASEON_PAPER", true);
};
this.DX = function (num) {
var strOutput = "";
var strUnit = '仟佰拾亿仟佰拾万仟佰拾元角分';
num += "00";
var intPos = num.indexOf('.');
if (intPos >= 0)
num = num.substring(0, intPos) + num.substr(intPos + 1, 2);
strUnit = strUnit.substr(strUnit.length - num.length);
for (var i = 0; i < num.length; i++)
strOutput += '零壹贰叁肆伍陆柒捌玖'.substr(num.substr(i, 1), 1) + strUnit.substr(i, 1);
return strOutput.replace(/零角零分$/, '整').replace(/零[仟佰拾]/g, '零').replace(/零{2,}/g, '零').replace(/零([亿|万])/g, '$1').replace(/零+元/, '元').replace(/亿零{0,3}万/, '亿').replace(/^元/, "零元");
};
this.printEnd = function () {
LODOP.PRINT();
};
this.printFee = function () { };
this.printFeeRefund = function () { };
this.measureString = function (s, f) {
//计算文字宽度
return { width: s.length * f.FontSize, height: f.FontSize };
}
this.printLine = function (x1, y1, x2) {
LODOP.ADD_PRINT_Line(y1, x1,y1, x2, 0, 1);
};
this.printString = function (s, f, x, y) {
LODOP.ADD_PRINT_TEXT(y, x, 1000, 25, s);
LODOP.SET_PRINT_STYLEA(0, "FontName", f.FontName);
LODOP.SET_PRINT_STYLEA(0, "FontSize", f.FontSize);
};
}
function PrinterPinA(printObj, printCopys, printCopysYAdd,y5,y6,y7,y8,y9) {
PrintBase.call(this, printObj);
this.maxCount = 12;
this.currentPage = 1;
this.xTitle = 370;
this.yy = 25;
this.x1 = 70;
this.x2 = 200;
this.x3 = 330;
this.x4 = 460;
this.x5 = 630;
this.x6 = 727;
this.y1 = 65;
this.y2 = 80;
this.y3 = 90;
this.y4 = 115;
this.y5 = y5;
this.y6 = y6;
this.y7 = y7;
this.y8 = y8;
this.y9 = y9;
this.printCopys = printCopys;
this.printCopysYAdd = printCopysYAdd;
this.totalPages = Math.ceil(printObj.listFee.length / this.maxCount);
this.printNormal = function (yAdd) {
if (yAdd > 0) {
this.printLine(0, yAdd, 900);
}
var title = this.printObj.schName + this.printObj.title; //计算文字宽度
var xTemp = (844 - this.measureString(title, this.hf).width) / 2;
this.printString(title, this.hf, xTemp, this.yy + yAdd);
this.printString("班级:" + this.printObj.clsName, this.nf, this.x1, this.y1 + yAdd);
this.printString("姓名:" + this.printObj.userName, this.nf, this.x2, this.y1 + yAdd);
this.printString("日期:" + this.printObj.payTime, this.nf, this.x4, this.y1 + yAdd);
this.printString("单号:" + this.printObj.serialNum, this.nf, this.x5, this.y1 + yAdd);
this.printLine(this.x1, this.y2 + yAdd, this.x6);
this.printLine(this.x1, this.y6 + yAdd, this.x6);
this.printString("合计:", this.nf, this.x1, this.y5 + yAdd);
var printphoneX = this.x1;
var printaddressY = this.y7;
if (printObj.schName) {
printphoneX = this.x2;
printaddressY = this.y8;
this.printString(printObj.schName, this.nf, this.x1, this.y7 + yAdd);
}
if (printObj.tel) {
printaddressY = this.y8;
this.printString("电话:" + printObj.tel, this.nf, printphoneX, this.y7 + yAdd);
}
if (printObj.printSeal) {
printaddressY = this.y8;
this.printString("盖章", this.nf, this.x5, this.y7 + yAdd);
}
if (printObj.schAddress) {
this.printString("地址:" + printObj.schAddress, this.nf, this.x1, printaddressY + yAdd);
}
var fstr = "退款人";
if (printObj.feeType==1) {
fstr = "收款人";
}
fstr += ":" + printObj.payee;
this.printString(fstr, this.nf, this.x5, printaddressY + yAdd);
};
this.printFee = function () {//打印收费
this.printBegin();
for (var i = 0; i < this.printCopys; i++) {
var yAdd = i * this.printCopysYAdd;
this.printNormal(yAdd);
var total = 0, real = 0, qian = 0, discount = 0;
var y = this.y4 + yAdd;
this.printString("项目", this.nf, this.x1, this.y3 + yAdd);
this.printString("应收金额(元)", this.nf, this.x2, this.y3 + yAdd);
this.printString("实收金额(元)", this.nf, this.x3, this.y3 + yAdd);
this.printString("备注", this.nf, this.x4, this.y3 + yAdd); //遍历打印
for (var j = (this.currentPage - 1) * this.maxCount; j < printObj.listFee.length && j < this.currentPage * this.maxCount; j++) {
var temp = printObj.listFee[j];
this.printString(temp.feeName, this.nf, this.x1, y);
this.printString(temp.totalMoney.toFixed(2), this.nf, this.x2, y);
this.printString(temp.realMoney.toFixed(2), this.nf, this.x3, y);
this.printString(temp.payMsg, this.nf, this.x4, y); total += temp.totalMoney;
real += temp.realMoney;
qian += temp.qianOldMoney;
discount += temp.discountMoney;
y += this.yy;
} this.printString("应收:" + total.toFixed(2) + "元", this.nf, this.x2, this.y5 + yAdd);
this.printString("实收:" + real.toFixed(2) + "元", this.nf, this.x3, this.y5 + yAdd);
this.printString("大写:" + this.DX(real), this.nf, this.x4, this.y5 + yAdd);
if (qian) {
this.printString("欠费:" + qian.toFixed(2) + "元", this.nf, this.x3, this.y9 + yAdd);
}
if (discount) {
this.printString("减免:" + discount.toFixed(2) + "元", this.nf, this.x4, this.y9 + yAdd);
}
}
this.printEnd();
if (this.currentPage * this.maxCount < printObj.listFee.length) {
this.currentPage++;
this.printFee();
}
};
this.printFeeRefund = function () {//打印退费
this.printBegin();
for (var i = 0; i < this.printCopys; i++) {
var yAdd = i * this.printCopysYAdd;
this.printNormal(yAdd);
var real = 0;
var y = this.y4 + yAdd;
this.printString("退费项目", this.nf, this.x1, this.y3 + yAdd);
this.printString("退费金额(元)", this.nf, this.x3, this.y3 + yAdd);
this.printString("备注", this.nf, this.x4, this.y3 + yAdd); //遍历打印
for (var j = (this.currentPage - 1) * this.maxCount; j < printObj.listFee.length && j < this.currentPage * this.maxCount; j++) {
var temp = printObj.listFee[j];
this.printString(temp.feeName, this.nf, this.x1, y);
this.printString(temp.realMoney.toFixed(2), this.nf, this.x3, y);
this.printString(temp.payMsg, this.nf, this.x4, y); real += temp.realMoney;
y += this.yy;
} this.printString("退费:" + real.toFixed(2) + "元", this.nf, this.x3, this.y5 + yAdd);
this.printString("大写:" + this.DX(real), this.nf, this.x4, this.y5 + yAdd);
}
this.printEnd();
if (this.currentPage * this.maxCount < printObj.listFee.length) {
this.currentPage++;
this.printFee();
}
}
} function PrinterPin140(printObj) {//a4 2等分
PrinterPinA.call(this, printObj, 1, -1, 415, 455, 465, 490, 440);
} function PrinterPinA4(printObj)//a4 双份
{
PrinterPinA.call(this, printObj, 2, 540, 415, 455, 465, 490, 440);
}
function PrinterPin93(printObj) {
PrinterPinA.call(this, printObj, 1, -1, 265, 305, 310, 335, 290);
}
function PrinterTicket(printObj,x1,x2,x3,x4,totalWidth,hfSize,hf2Size,addrSize)
{
PrintBase.call(this, printObj);
this.y = 5;
this.x1 = x1;
this.x2 = x2;
this.x3 = x3;
this.x4 = x4;
this.yy = 15;
this.yh = 20;
this.yx = 10;
this.totalWidth = totalWidth;
this.addrSize = addrSize;
this.hf = { FontName: '宋体', FontSize: hfSize };
this.hf2 = { FontName: '宋体', FontSize: hf2Size };
this.printFoot = function (total, qian, real, discount) {
this.printLine(this.x1, this.y, this.totalWidth - this.x1);
this.y += this.yx;
this.printString("合计:" + printObj.listFee.length + "项", this.nf, this.x1, this.y);
this.y += this.yy;
if (printObj.feeType) {
this.printString("应收:" + total.toFixed(2) + "元", this.nf, this.x1, this.y);
this.y += this.yy;
if (qian) {
this.printString("欠费:" + qian.toFixed(2) + "元", this.nf, this.x1, this.y);
this.y += this.yy;
}
if (discount) {
this.printString("减免:" + discount.toFixed(2) + "元", this.nf, this.x1, this.y);
this.y += this.yy;
}
this.printString("实收:" + real.toFixed(2) + "元", this.nf, this.x1, this.y);
this.y += this.yy;
} else {
this.printString("退费:" + real.toFixed(2) + "元", this.nf, this.x1, this.y);
this.y += this.yy;
}
this.printString("大写:" + this.DX(real), this.nf, this.x1, this.y);
this.y += this.yy;
var fstr = "退款人";
if (printObj.feeType==1) {
fstr = "收款人";
}
fstr += ":" + printObj.payee;
this.printString(fstr, this.nf, this.x1, this.y);
this.y += this.yy;
if (printObj.tel || printObj.schAddress) {
this.printLine(this.x1, this.y, (this.totalWidth - this.x1));
this.y += this.yx;
}
if (printObj.tel) {
this.printString("电话:" + printObj.tel, this.nf, this.x1, this.y);
this.y += this.yy;
}
if (printObj.schAddress) {
var add1 = printObj.schAddress;
var add2 = '';
//判断要打印的行数
var rows = Math.ceil(add1.length / this.addrSize);
for (var i = 0; i < rows; i++) {
var end=(i+1)*this.addrSize;
if(end>add1.length)end=add1.length;
var temp = add1.substring(i * this.addrSize, end);
if (i == 0) {
this.printString("地址:" + temp, this.nf, this.x1, this.y);
} else {
this.printString(temp, this.nf, this.x1 * 8, this.y);
}
this.y += this.yy;
}
}
};
this.printHead = function () {
if (printObj.schName) {
var fs = this.measureString(printObj.schName, this.hf);
var xtemp1 = (this.totalWidth - fs.width) / 2;
this.printString(printObj.schName, this.hf, xtemp1, this.y);
this.y += this.yh;
}
var f2 = this.measureString(printObj.title, this.hf2);
var xtemp2 = (this.totalWidth - f2.width) / 2;
this.printString(printObj.title, this.hf2, xtemp2, this.y);
this.y += this.yh;
this.printString("日期:" + printObj.payTime, this.nf, this.x1, this.y);
this.printString("单号:" + printObj.serialNum, this.nf, this.x2, this.y);
this.y += this.yy;
this.printString("姓名:" + printObj.userName, this.nf, this.x1, this.y);
this.printString("班级:" + printObj.clsName, this.nf, this.x2, this.y);
this.y += this.yy;
this.printLine(this.x1, this.y, this.totalWidth - this.x1);
this.y += this.yx;
};
this.printFee = function () {//打印收费
this.printBegin();
this.printHead();
var total = 0, real = 0, qian = 0, discount = 0;
this.printString("项目", this.nf, this.x1, this.y);
this.printString("应收(元)", this.nf, this.x3, this.y);
this.printString("实收(元)", this.nf, this.x4, this.y);
this.y += this.yy; //遍历打印
for (var j = 0; j < printObj.listFee.length; j++) {
var temp = printObj.listFee[j];
var name = temp.feeName;
if(temp.payMsg)
{
name+='(' + temp.payMsg + ')';
}
this.printString(name,this.nf, this.x1, this.y);
this.y+=this.yy;
this.printString(temp.totalMoney.toFixed(2), this.nf, this.x3, this.y);
this.printString(temp.realMoney.toFixed(2), this.nf, this.x4, this.y);
total += temp.totalMoney;
real += temp.realMoney;
qian += temp.qianOldMoney;
discount += temp.discountMoney;
this.y += this.yy;
} this.printFoot(total, qian, real, discount);
this.printEnd();
};
this.printFeeRefund = function () {//打印退费
this.printBegin();
this.printHead();
var real = 0;
this.printString("项目", this.nf, this.x1, this.y);
this.printString("退费(元)", this.nf, this.x4, this.y);
this.y += this.yy; //遍历打印
for (var j = 0; j < printObj.listFee.length ; j++) {
var temp = printObj.listFee[j];
var name = temp.feeName;
if (temp.payMsg) {
name += '(' + temp.payMsg + ')';
}
this.printString(name, this.nf, this.x1, this.y);
this.y += this.yy;
this.printString(temp.realMoney.toFixed(2), this.nf, this.x4, this.y);
real += temp.realMoney;
this.y += this.yy;
}
this.printFoot(0, 0, real, 0);
this.printEnd();
};
}
function PrinterTicket80(printObj) {
PrinterTicket.call(this, printObj, 5, 180, 120, 200, 280, 12, 10,20);
}
function PrinterTicket76(printObj) {
PrinterTicket.call(this, printObj, 5, 155, 105, 185, 266, 12, 10,18);
}
function PrinterTicket50(printObj) {
PrinterTicket.call(this, printObj, 5, 180, 60, 120, 192, 10, 8,11);
this.printHead = function () {
if (printObj.schName) {
var fs = this.measureString(printObj.schName, this.hf);
var xtemp1 = (this.totalWidth - fs.width) / 2;
this.printString(printObj.schName, this.hf, xtemp1, this.y);
this.y += this.yh;
}
var f2 = this.measureString(printObj.title, this.hf2);
var xtemp2 = (this.totalWidth - f2.width) / 2;
this.printString(printObj.title, this.hf2, xtemp2, this.y);
this.y += this.yh;
this.printString("日期:" + printObj.payTime, this.nf, this.x1, this.y);
this.y += this.yy;
this.printString("单号:" + printObj.serialNum, this.nf, this.x1, this.y);
this.y += this.yy;
this.printString("班级:" + printObj.clsName, this.nf, this.x1, this.y);
this.y += this.yy;
this.printString("姓名:" + printObj.userName, this.nf, this.x1, this.y);
this.y += this.yy;
this.printLine(this.x1, this.y, this.totalWidth - this.x1);
this.y += this.yx;
};
}
$.extend({
Print: function (printObj) {
if (printObj.PrintSet.printerName) {
var pt;
switch (printObj.PrintSet.printerType) {
case 1:
pt = new PrinterPin140(printObj);
break;
case 2:
pt = new PrinterPin93(printObj);
break;
case 3:
pt = new PrinterTicket80(printObj);
break;
case 4:
pt = new PrinterTicket76(printObj);
break;
case 5:
pt = new PrinterTicket50(printObj);
break;
case 6:
pt = new PrinterPinA4(printObj);
break;
}
if (pt) {
var k = 0;
var si = setInterval(function () {
if (k < printObj.PrintSet.printNumber) {
k++;
if (printObj.feeType == 1) {
pt.printFee(printObj);
} else {
pt.printFeeRefund(printObj);
}
}
else
{
clearInterval(si);
}
}, 200);
}
}
}
});
})(jQuery);
lodop打印收费小票的更多相关文章
- [原创]Lodop打印, 以及Lodop引用css文件控制打印样式的问题.
最近在做Lodop打印功能: 思路是: 用MasterPage搭个打印页面的框架, 然后在具体的页面中填入数据, 打印的样式由母版页和CSS来控制. 困扰了一天的问题是: 在打印的JS文件中, 引 ...
- chrome升级后LODOP打印插件无法使用
今天帮朋友使用LODOP实现一个套打程序时,发现LODOP打印插件在chrome下始终无法使用.分析后发现是自己才升级了chrome,chrome新版默认是禁用npapi的,因此需要手动启用一下,启用 ...
- LODOP打印控件示例
一.lodop打印预览效果图 LODOP.PRINT_SETUP();打印维护效果图 LODOP.PREVIEW();打印预览图 二.写在前面 最近项目用到了LODOP的套打,主要用到两个地方,一是物 ...
- LODOP打印当前日期时间的方法
JS方法直接获取.之前有个详细介绍的博文:LODOP打印用JS获取的当前日期本文也再演示一下,详细介绍见上面链接的博文,该方法此文不做详细介绍. 本文有三段:1.JS获取日期,2,.LODOP的FOR ...
- LODOP打印用JS获取的当前日期
该文详细一步步解释JS获取当前时间的方法,新手小白也看到懂,最后是实际的获取当前年月份的方法.JS中的Date()对象,包含很多当前系统时间的方法,首先建立一个Date()对象,这里取名为date,然 ...
- Lodop打印控件在页面如何使用
Lodop打印控件部署到web服务器简单,在页面的使用方法也简单,是非常容易和方便使用的打印控件.客户端本地打印角色(即用户访问网站后 用自己链接的打印机进行客户端本地打印),步骤很少,部署简单:Lo ...
- Lodop打印表格带页头页尾 自动分页每页显示头尾
Lodop中有两种专门给超文本表格的方式,ADD_PRINT_TABLE和ADD_PRINT_TBURL,该方式只能用于单个表格,表格外的内容不显示,是专门用于打印html超文本表格的.使用这两个语句 ...
- Lodop打印表格带页头页尾 高度是否包含页头页尾
通过设置TableHeightScope,可以实现对ADD_PRINT_TABLE,表格带页头页尾,查看本博客另一篇博文:Lodop打印表格带页头页尾 自动分页每页显示头尾 超文本超过打印项高度,会自 ...
- Lodop打印控件传入css样式、看是否传入正确样式
Lodop中可以传入页面存在的css样式,也可以是拼接后的新样式,例如本博客的其他博文:Lodop打印如何隐藏table某一列 需要打印的页面,样式不一定都是行内样式,style样式单独写在页面上,或 ...
随机推荐
- python入门(9)字符串和编码
python入门(9)字符串和编码 字符串是一种数据类型,比较特殊的是字符串有一个编码问题. 因为计算机只能处理数字,如果要处理文本,就必须先把文本转换为数字才能处理. 最早的计算机在设计时采用8个比 ...
- java 数组排序方法整理,简单易懂,
1.快速排序:首先是最简单的Array.sort,直接进行排序: public static void main(String[] args) { int[] arr = {4,3,5,1,7,9,3 ...
- Lua编写wireshark插件初探——解析Websocket上的MQTT协议
一.背景 最近在做物联网流量分析时发现, App在使用MQTT协议时往往通过SSL+WebSocket+MQTT这种方式与服务器通信,在使用SSL中间人截获数据后,Wireshark不能自动解析出MQ ...
- Android智能手机上的音频浅析
手机可以说是现在人日常生活中最离不开的电子设备了.它自诞生以来,从模拟的发展到数字的,从1G发展到目前的4G以及不久将来的5G,从最初的只有唯一的功能(打电话)发展到目前的全功能,从功能机(featu ...
- 教你如何用AST语法树对代码“动手脚”
个推安卓工程师,负责公司移动端项目的架构和开发,主导移动端日志管理平台系统架构和开发工作,熟悉前后端的技术线,参与个推SDK主要业务研发工作,善于解决项目中遇到的痛点问题. 作为程序猿,每天都在写代码 ...
- Typescript学习
一 什么是Typescript 简单的说,TypeScript 是 JavaScript 的一个超集,主要提供了类型系统和对 ES6 的支持,它由 Microsoft 开发,代码开源于 GitHub ...
- 40叔:自学的伙伴推荐看的PHP视频和书藉
记录一下我的学习编程经历,在自学的路上,看了不少的断断续续的看了不少的视频,现在只会一点PHP增删改查. 同样迷的有没有? 要自己用原生的开发个CMS 或者BBS,ask 系统好像还差的远. 所以回头 ...
- Xshell5下利用sftp上传下载传输文件
sftp是Secure File Transfer Protocol的缩写,安全文件传送协议.可以为传输文件提供一种安全的加密方法.sftp 与 ftp 有着几乎一样的语法和功能.SFTP 为 SSH ...
- .NET CORE 2.0之 依赖注入在类中获取IHostingEnvironment,HttpContext
在.NET CORE 中,依赖注入非常常见, 在原先的 HttpContext中常用的server.Mappath已经么有了如下: HttpContext.Current.Server.MapPath ...
- “百度杯”CTF比赛 2017 二月场_onthink
题目在i春秋ctf训练营中能找到,这题直接拿大佬的wp来充数 百度找到onethinnk的一个漏洞. 参考:http://www.hackdig.com/06/hack-36510.htm 就是注册个 ...