unity3d导出pdf
unity生成pdf格式,首先需要导入iTextSharp.dll ,下面是我写的一些方法,可以直接用.直接贴代码,
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using iTextSharp.text.pdf;
using iTextSharp.text;
using System.Text.RegularExpressions;
using System.Data.OracleClient;
using System; //需要用到的数据结构
public class PdfUserInformation
{
public string goodsName;
public string youzhanType;
public string cvsLevel;
public string writeTime;
public string creater;
public string creatTime;
};
//数据结构
public class PdfInformation
{
public string mID;
public string mName;
public string mReserve;
// ....
}; public class PDFMakerManager { public static PDFMakerManager PDFInstance;
public static PDFMakerManager createPDFMakerManager()
{
if(PDFInstance==null)
{
PDFInstance = new PDFMakerManager ();
} return PDFInstance;
} //获取物品的子物体名字 通过子物体的名字获取物体 返回物体的链表
public List<PdfInformation> getObjChildsName(Transform mParentObj)
{ if(mParentObj!=null)
{
List<string> mChildObjs = new List<string>();
List<PdfInformation> mInfoList = new List<PdfInformation>();
foreach (Transform mChildTransform in mParentObj)
{
mChildObjs.Add(mChildTransform.gameObject.name);
Debug.Log(mChildTransform.gameObject.name);
}
//获取 数据库 信息
getPdfDatasFromDB();
//通过子物体的名字 获取物体信息
for (int i = 0; i < mChildObjs.Count; i++)
{
mInfoList.Add(mDirectoryData[mChildObjs[i]]);
}
return mInfoList;
}
return null;
}
//每行五个 还有问题,由于需求以及时间关系,没时间去管了 谁看到了可以帮忙解决下,.thanks
List<PdfInformation> mGoodsInfoList = new List<PdfInformation>();
public List<List<PdfInformation>> getAllGoods(List<PdfInformation> mList)
{
List<List<PdfInformation>> mGoodsAll = new List<List<PdfInformation>>();
List<List<PdfInformation>> mGoods = new List<List<PdfInformation>>(); for (int i = 1; i <= mList.Count;i++ )
{
mGoodsInfoList.Add(mList[i-1]); if(i%5==0)
{ mGoodsAll.Add(mGoodsInfoList);
Debug.Log("xx"+mGoodsInfoList.Count);
mGoodsInfoList.Clear(); for (int j = 0; j < mGoodsAll.Count; j++)
{
Debug.Log("InfoList [[[" + j + "]]]is:" + mGoodsAll[j].Count);
} }else if(i%5!=0&&i==mList.Count)
{
mGoodsAll.Add(mGoodsInfoList);
mGoodsInfoList.Clear();
}
}
Debug.Log("InfoList [[[is:" + mGoodsAll.Count);
//for (int j = 0; j < mGoodsAll.Count;j++ )
//{
// Debug.Log("InfoList [[[" + j + "]]]is:" + mGoodsAll[j].Count);
//} return mGoodsAll;
}
//从数据库 获取 PDF 信息
Dictionary<string, PdfInformation> mDirectoryData = new Dictionary<string, PdfInformation>();
public List<PdfInformation> getPdfDatasFromDB()
{
List<PdfInformation> mInfoList = new List<PdfInformation>(); Oracle mDB = new Oracle ();
try
{
string mSearch = "select * from mdb";
mInfoList = mDB.Select(mSearch);
mDirectoryData = mDB.getPdfDictionary();
}catch(Exception e)
{
mDB.Close();
Debug.Log("sql error");
}
return mInfoList;
} // / pdf 行
public PdfPTable CreateRankGoodsInforMationTable(List<List<PdfInformation>> mList)
{
PdfPTable mTable=new PdfPTable(1); mTable.SetTotalWidth(new float[]{300}); mTable.HorizontalAlignment = PdfPTable.LINECANVAS; if(mList.Count>0)
{
for(int i=0;i<mList.Count;i++)
{
Debug.Log("xx"+i+"xxxxxx:"+mList[i].Count);
// mTable.AddCell(CreateCell(CreateRowGoodsInforMationTable2(mList[i]),-1,0));
} } mTable.LockedWidth = true;
return mTable;
}
//
//pdf 列
PdfPTable CreateRowGoodsInforMationTable2(System.Collections.Generic.List<PdfInformation> mList)
{
PdfPTable mTable =new PdfPTable (mList.Count);
System.Collections.Generic.List<float> Width = new System.Collections.Generic.List<float> ();
if(mList.Count>0)
{
for(int i=0;i<mList.Count;i++)
{
Width.Add(80f);
}
}
float []mWidth = Width.ToArray();
mTable.HorizontalAlignment = PdfPTable.BACKGROUNDCANVAS; if (mWidth[0] != -1)
{
mTable.SetTotalWidth(mWidth);
}
mTable.LockedWidth = true;
for(int i=0;i<mList.Count;i++)
{ mTable.AddCell(CreateGoodsInformationCell(mList[i]));
}
mList.Clear();
return mTable;
} //pdf 图 暂时没用
byte[] GoodsImgPrint(Camera SmallCamera,GameObject TakeHuoJia)
{
int swidth = (int)(SmallCamera.WorldToScreenPoint(TakeHuoJia.transform.position + TakeHuoJia.renderer.bounds.size).x - SmallCamera.WorldToScreenPoint(TakeHuoJia.transform.position - TakeHuoJia.renderer.bounds.size).x); RenderTexture rt = new RenderTexture(Screen.width, resHeight, 72);
SmallCamera.pixelRect = new Rect(0, 0, Screen.width, Screen.height);
SmallCamera.targetTexture = rt;
Texture2D screenShot = new Texture2D(swidth + 100, resHeight, TextureFormat.ARGB32, false);
SmallCamera.Render();
RenderTexture.active = rt; screenShot.ReadPixels(new Rect(SmallCamera.WorldToScreenPoint(TakeHuoJia.transform.position - TakeHuoJia.renderer.bounds.size).x, 0, swidth + 100, resHeight), 0, 0);
screenShot.Apply();
SmallCamera.targetTexture = null;
RenderTexture.active = null; //
UnityEngine.Object.Destroy(rt);
byte[] bytes = screenShot.EncodeToPNG(); return bytes;
}
//打印物品详细信息 图 (左边字 右边图 分开的 ,写法一:pdf字和摄像头图)
public void PrintGoodsInformations2(string filePath, Camera mCam, GameObject mObj, PdfUserInformation mInfo)
{
Document document = new Document(new Rectangle(PageSize.A4.Height, PageSize.A4.Width));
PdfWriter.GetInstance(document, new FileStream(filePath, FileMode.Create));
document.Open(); PdfPTable tableAll = tableAll = CreateTable(2, PdfPTable.BACKGROUNDCANVAS, new float[] { document.PageSize.Width / 2 - 50, document.PageSize.Width / 2 - 50 }, true);
//
PdfPTable tableLeft = PrintGoodsInformations_Left(mInfo); Image tableRight = MakeCameraImg(mCam, 512, 512);//Image.GetInstance( GoodsImgPrint(mCam,mObj)); tableAll.AddCell(CreateCell(tableLeft, -1, 0));
tableAll.AddCell(CreateCell(tableRight, -1, 0));
document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath);
}
//打印物品详细信息 图 (左边字 右边图 分开的 ,写法2:摄像头全图,包括字和图)
public void PrintGoodsInformations(string filePath, Camera mCam,GameObject mObj,PdfUserInformation mInfo)
{
Document document = new Document(new Rectangle(PageSize.A4.Height, PageSize.A4.Width));
PdfWriter.GetInstance(document, new FileStream(filePath, FileMode.Create));
document.Open(); PdfPTable tableAll = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] {document.PageSize.Width -100 }, true);
//
PdfPTable tableLeft = PrintGoodsInformations_Left(mInfo); Image tableRight = MakeCameraImg(mCam,680,512);//Image.GetInstance( GoodsImgPrint(mCam,mObj)); // tableAll.AddCell(CreateCell(tableLeft, -1, 0));
tableAll.AddCell(CreateCell(tableRight, -1, 0));
document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath);
} //打印物品详细信息 左边字 右边字
public void PrintGoodsInformations(string filePath,PdfUserInformation mInfo)
{
Document document = new Document(new Rectangle(PageSize.A4.Height,PageSize.A4.Width));
PdfWriter.GetInstance(document,new FileStream(filePath,FileMode.Create));
document.Open(); PdfPTable tableAll = CreateTable(2, PdfPTable.BACKGROUNDCANVAS, new float[] { document.PageSize.Width / 2 - 50, document.PageSize.Width / 2 - 50 }, true);
//
PdfPTable tableLeft = PrintGoodsInformations_Left(mInfo); //测试数据 ....
PdfInformation mInfo1 = new PdfInformation();
mInfo1.mName = "aaaa";
PdfInformation mInfo2 = new PdfInformation();
mInfo2.mName = "bbbbb"; List<PdfInformation> mInfoList = new List<PdfInformation>();
mInfoList.Add(mInfo1);
mInfoList.Add(mInfo2); PdfInformation mInfo3 = new PdfInformation();
mInfo3.mName = "ccccc";
PdfInformation mInfo4 = new PdfInformation();
mInfo4.mName = "ddddd"; List<PdfInformation> mInfoList2 = new List<PdfInformation>();
mInfoList2.Add(mInfo3);
mInfoList2.Add(mInfo4); List<List<PdfInformation>> mLLInfo = new List<List<PdfInformation>>();
mLLInfo.Add(mInfoList);
mLLInfo.Add(mInfoList2); //....... //测试数据 数据库数据
// List<List<PdfInformation>> mDBTestList = new List<List<PdfInformation>>();
//mDBTestList = getAllGoods(getPdfDatasFromDB()); //Debug.Log("DBList is:"+mDBTestList.Count);
//...... PdfPTable tableRight = CreateRankGoodsInforMationTable(mDBTestList);
tableRight.HorizontalAlignment = PdfPTable.BACKGROUNDCANVAS;
tableAll.AddCell(CreateCell(tableLeft, -1, 0));
tableAll.AddCell(CreateCell(tableRight,-1,0));
document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath); }
//详细信息的左半部分
PdfPTable PrintGoodsInformations_Left(PdfUserInformation mInfo)
{
PdfPTable tableHeaderR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { -1 }, false);
PdfPTable tableHeaderminiR = CreateTable(2, PdfPTable.BACKGROUNDCANVAS, new float[] { 1, 3 }, false); Image mark = Image.GetInstance(Application.dataPath + "/Icon.png");
mark.ScaleAbsolute(250, 250);
mark.Alignment = Image.LEFT_BORDER;
tableHeaderminiR.AddCell(CreateCell(mark, 2, 0));//<<<<<<<<< //tableHeaderminiR.AddCell(CreateCell("商品", -1, 0, CreateFont(32, iTextSharp.text.Font.NORMAL)));//<<<<<<<<
tableHeaderminiR.AddCell(CreateCell("标题", -1, 0, CreateFont(32, iTextSharp.text.Font.NORMAL)));//<<<<<<<<
tableHeaderminiR.AddCell(CreateCell("xxx", -1, 0, CreateFont(22, iTextSharp.text.Font.NORMAL)));//<<<<<<<< PdfPTable tableDataR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { 350 }, true);
tableDataR.AddCell(CreateCell("\n", -1, 0, CreateFont(12, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("名称:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.goodsName, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("类型:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.youzhanType, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("级别:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.cvsLevel, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("时间:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.writeTime, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("创建者:", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.creater, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("创建时间:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.creatTime, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableHeaderR.AddCell(CreateCell(tableHeaderminiR, -1, 0));//<<<<<<<<
tableHeaderR.AddCell(CreateCell(tableDataR, -1, 0)); return tableHeaderR;
} //把摄像头视野 制作成png图片
private Rect CutRect = new Rect(0, 0, 1, 1);
private int resWidth = 710;
private int resHeight = 512;
private Image MakeCameraImg(Camera mCam,int width,int height)
{
Image mImage;
RenderTexture rt = new RenderTexture(width, height, 2);
mCam.pixelRect = new Rect(0, 0, Screen.width, Screen.height);
mCam.targetTexture = rt;
Texture2D screenShot = new Texture2D((int)(width * CutRect.width), (int)(height * CutRect.height),
TextureFormat.RGB24, false);
mCam.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(width * CutRect.x, width * CutRect.y, width * CutRect.width, height * CutRect.height), 0, 0);
mCam.targetTexture = null;
RenderTexture.active = null;
UnityEngine.Object.Destroy(rt);
byte[] bytes = screenShot.EncodeToPNG();
//string filename = Application.dataPath + "/Print/3D"
// + System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".png";
//System.IO.File.WriteAllBytes(filename, bytes); mImage = Image.GetInstance(bytes);
return mImage; }
//打印图片 (摄像头视野看到的/生成的图片) 成PDF
public void PrintImgPdf(string filePath, Camera mCam)
{
Document document = new Document(new Rectangle(PageSize.A4.Height, PageSize.A4.Width));
PdfWriter.GetInstance(
document,
new FileStream(filePath, FileMode.Create)
); document.Open();
Image imge;
imge = MakeCameraImg(mCam,700,512);
PdfPTable tableAll = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { document.PageSize.Width -50}, true);
PdfPTable tableHeaderR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { -1 }, false);
PdfPTable tableHeaderminiR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { 1 }, false);
//
Image mark = imge;
mark.ScaleAbsolute(mark.Width, mark.Height);
mark.Alignment = Image.LEFT_BORDER;
tableHeaderminiR.AddCell(CreateCell(mark, 2, 0));//<<<<<<<<< tableHeaderR.AddCell(CreateCell(tableHeaderminiR, -1, 0));//<<<<<<<<
tableAll.AddCell(CreateCell(tableHeaderR, -1, 0));//<<<<<<<< document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath); }
public PdfPTable CreateTable(int numCol, int HorizontalAlignmentStyle, float[] Width, bool isLockedWidth)
{
PdfPTable tableAll = new PdfPTable(numCol);
tableAll.HorizontalAlignment = HorizontalAlignmentStyle;
if (Width[0] != -1)
{
tableAll.SetTotalWidth(Width);
}
tableAll.LockedWidth = isLockedWidth;
return tableAll;
} public PdfPCell CreateCell(PdfPTable table, int rowspan, int borderStyle)
{
PdfPCell cell = new PdfPCell(table);
if (borderStyle != -1 && borderStyle >= 0)
{
cell.Border = borderStyle;
}
if (rowspan != -1)
{
cell.Rowspan = rowspan;
} cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_LEFT | PdfPCell.ALIGN_CENTER;
return cell;
} public PdfPCell CreateCell(Image image, int rowspan, int borderStyle)
{
PdfPCell cell = new PdfPCell(image);
if (borderStyle != -1 && borderStyle >= 0)
{
cell.Border = borderStyle;
}
if (rowspan != -1)
{
cell.Rowspan = rowspan;
}
cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_BASELINE;
return cell;
} public PdfPCell CreateCell(string text, int rowspan, int borderStyle, iTextSharp.text.Font cellFont)
{
PdfPCell cell = new PdfPCell(new Phrase(text, cellFont));
if (borderStyle != -1 && borderStyle>=0)
{
cell.Border = borderStyle;
}
if (rowspan != -1)
{
cell.Rowspan = rowspan;
} cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_CENTER;
return cell;
}
/// <summary> 只在详细信息的时候用
PdfPCell CreateGoodsInformationCell(PdfInformation mInfo)
{ string text = mInfo.mName +"\n";
iTextSharp.text.Font font =CreateFont(20, iTextSharp.text.Font.NORMAL);
PdfPCell cell = new PdfPCell(new Phrase(text,font));
cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_LEFT; return cell; }
/// </param>/ public void CellAddTable(PdfPCell cell,PdfPTable table)
{
cell.AddElement(table);
}
public iTextSharp.text.Font CreateFont(float fontSize, int fontStyle)
{
BaseFont bfChinese = BaseFont.CreateFont( Application.dataPath + "/font/MSYH.TTF",
BaseFont.IDENTITY_H,
BaseFont.NOT_EMBEDDED ); return new iTextSharp.text.Font(bfChinese, fontSize, fontStyle);
} }
下面是调用:
using UnityEngine;
using System.Collections; public class PrintPdf : MonoBehaviour { //需要将这几个摄像头绑定对应的
PDFMakerManager mPdfManager;
public Camera m3DCamera;
public Camera mHightCam;
public GameObject mObj;
public Camera mInfoCamera;
string mPdfPath; public GameObject[] Texts = new GameObject[6];
public string[] Textstext;
PdfUserInformation mPDFUserInfo;
// Use this for initialization
void Start () { Textstext = new string[6];
mPdfManager = new PDFMakerManager();
mPDFUserInfo = new PdfUserInformation(); } // Update is called once per frame
void Update () { } void OnGUI()
{ if (GUI.Button(new Rect(100, 100, 100, 40), "PdfInfoPrint"))
{ PrintInfoPdf();
}
if (GUI.Button(new Rect(300, 100, 100, 40), "PdfInfoImgPrint"))
{ PrintInfoImgPdf();
}
if (GUI.Button(new Rect(400, 100, 100, 40), "PdfHightPrint"))
{
PrintHightImgPdf();
}
} // 还需要把摄像头绑定对
// 把写字的物体绑定对
// 在 调用函数 需要 找对 位置
public void getText()
{
for (int i = 0; i < Texts.Length; i++)
{
Textstext[i] = Texts[i].GetComponent<UILabel>().text;
}
mPDFUserInfo.goodsName = Textstext[0];
mPDFUserInfo.youzhanType = Textstext[1];
mPDFUserInfo.cvsLevel = Textstext[2];
mPDFUserInfo.writeTime = Textstext[3];
mPDFUserInfo.creater = Textstext[4];
mPDFUserInfo.creatTime = Textstext[5]; }
//打印 左边字 右边表格
public void PrintInfoPdf()
{
getText();
mPdfManager.PrintGoodsInformations(mPdfPath,mPDFUserInfo);
}
//打印 信息 图片
public void PrintInfoImgPdf()
{ getText();
mPdfPath = Application.dataPath + "/Print/InfoImg"
+ System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".pdf"; mPdfManager.PrintGoodsInformations(mPdfPath, mInfoCamera, mObj, mPDFUserInfo); } //打印 图
public void PrintHightImgPdf()
{
mPdfPath = Application.dataPath + "/Print/Top"
+ System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".pdf";
mPdfManager.PrintImgPdf(mPdfPath, mHightCam); }
}
注:如需转载,请注明出处,
unity3d导出pdf的更多相关文章
- .Net导出pdf文件,C#实现pdf导出
最近碰见个需求需要实现导出pdf文件,上网查了下代码资料总结了以下代码.可以成功的实现导出pdf文件. 在编码前需要在网上下载个itextsharp.dll,此程序集是必备的.楼主下载的是5.0版本, ...
- GJM :Unity3d导出eclipse工程,导入Android Studio
unity3d导出eclipse工程,导入Android Studio 标签: unity3Dandroid studio 2016-08-11 10:42 398人阅读 评论(1) 收藏 举报 分类 ...
- JS导出PDF插件(支持中文、图片使用路径)
在WEB上想做一个导出PDF的功能,发现jsPDF比较多人推荐,遗憾的是不支持中文,最后找到pdfmake,很好地解决了此问题.它的效果可以先到http://pdfmake.org/playgroun ...
- ITextSharp导出PDF表格和图片(C#)
文章主要介绍使用ITextSharp导出PDF表格和图片的简单操作说明,以下为ITextSharp.dll下载链接 分享链接:http://pan.baidu.com/s/1nuc6glj 密码:3g ...
- JAVA导出pdf实例
一.直接导出成PDF Java代码 1. import java.io.FileNotFoundException; 2. import java.io.FileOutputStream; 3. ...
- 利用ITextSharp导出PDF文件
最近项目中需要到处PDF文件,最后上网搜索了一下,发现ITextSharp比较好用,所以做了一个例子: public string ExportPDF() { //ITextSharp Usage / ...
- iText导出pdf、word、图片
一.前言 在企业的信息系统中,报表处理一直占比较重要的作用,本文将介绍一种生成PDF报表的Java组件--iText.通过在服务器端使用Jsp或JavaBean生成PDF报表,客户端采用超级连接显示或 ...
- Itext导出PDF,word,图片案例
iText导出pdf.word.图片 一.前言 在企业的信息系统中,报表处理一直占比较重要的作用,本文将介绍一种生成PDF报表的Java组件--iText.通过在服务器端使用Jsp或JavaBean生 ...
- Ireport 报表导出 Poi + ireport 导出pdf, word ,excel ,htm
Ireport 报表导出 Poi + ireport 导出pdf, doc ,excel ,html 格式 下面是报表导出工具类reportExportUtils 需要导出以上格式的报表 只需要调用本 ...
随机推荐
- C# Cookie编程
Cookie,他最早出现是在Netscape Navigator 2.0中.Cookie其实就是由Web服务器创建的.将信息存储在机上的文件.那么为什么Web服务器要在客户机上面创建如此文件?这是因为 ...
- 【LeetCode练习题】Minimum Depth of Binary Tree
Minimum Depth of Binary Tree Given a binary tree, find its minimum depth. The minimum depth is the n ...
- Dynamic Flash Messages
Dynamic Flash Messages的类似软件 - 其他jQuery插件 - 开源中国社区 Dynamic Flash Messages
- ssh 与 Telnet 的区别
简单来书,ssh 和 telnet 是实现相同的功能 , ssh中 数据是经过加密的,是安全的 , 而 Telnet是明文传输的ssh 是加密的,基于 SSL .telnet 是明码传输的,发送的数据 ...
- RequireJs运行原理
在require中,根据AMD(Asynchronous Module Definition)的思想,即异步模块加载机制,其思想就是把代码分为一个一个的模块来分块加载,这样无疑可以提高代码的重用. 在 ...
- onvif规范的实现:使用gSOAP创建SOAP调用实例
预备知识 ONVIF规范中设备管理和控制部分所定义的接口均以Web Services的形式提供.ONVIF规范涵盖了完全的XML及WSDL的定义.每一个支持ONVIF规范的终端设备均须提供与功能相应的 ...
- php中的short_open_tag的作用
在php的配置文件(php.ini)中有一个short_open_tag的值,开启以后可以使用PHP的段标签:(<? ?>). 同时,只有开启这个才可以使用 <?= 以代替 < ...
- C# ?? 操作符示例
static int? GetNullableInt() { return null; } static string GetStringValue() { return null; } static ...
- 《JavaScript 闯关记》之表达式和运算符
表达式 表达式是由数字.运算符.数字分组符号(如括号).自由变量和约束变量等以能求得数值的有意义排列方法所得的组合.JavaScript 表达式主要有以下几种形式: 原始表达式:常量.变量.保留字. ...
- jqGrid插件的重载表格的解决方案
jqGrid插件的重载表格的解决方案 $("#table_list_1").empty();// 清空表格内容 var parent=$("#gbox_table_lis ...