Jquery CDN ,

网站加载速度在线监测工具

此实现不是 Windows 平台 FIPS 验证的加密算法的一部分。

16
2015
10

telerik 的 RadDiagram控件 铅笔和钢笔工具默认不填充形状内的背景色

 

 

用铅笔和钢笔工具画图的时候, 形状默认会填充颜色, 如果是画形状还好,如果是画线的话就没必要填充颜色了, 设置如下:

 

首先要引用

xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Diagrams.Primitives;assembly=Telerik.Windows.Controls.Diagrams"

 

16
2015
10

Crop that pdf page horizontaly into 4 pieces and create a new pdf for each piece

 

  

Crop that pdf page horizontaly into 4 pieces and create a new pdf for each piece


 

Document document = new Document("D:\\AP Data\\copy.pdf");
 
//Create the Copy of the page
document.Pages.Insert(2, document.Pages[1]);
document.Pages.Insert(3, document.Pages[1]);
document.Pages.Insert(4, document.Pages[1]);
 
double segment = (document.Pages[1].Rect.Height / 4);
double half = (document.Pages[1].Rect.Height / 2);
double width = document.Pages[1].Rect.Width;
double height = document.Pages[1].Rect.Height;
 
//Create Crops
Aspose.Pdf.Rectangle pageRect = new Aspose.Pdf.Rectangle(0,  height - segment,width , height);
document.Pages[1].CropBox = pageRect;
 
pageRect = new Aspose.Pdf.Rectangle(0, height - half, width, height - segment);
document.Pages[2].CropBox = pageRect;
 
pageRect = new Aspose.Pdf.Rectangle(0, height - half, width, (height - half) - segment);
document.Pages[3].CropBox = pageRect;
 
pageRect = new Aspose.Pdf.Rectangle(0, 0, width, half - segment);
document.Pages[4].CropBox = pageRect;
 
document.Save("D:\\AP Data\\test_Crop.pdf");

16
2015
10

Crop Pdf from each edge

 

public void TrimPdf(string sourceFilePath, string outputFilePath)
  {
        PdfReader pdfReader = new PdfReader(sourceFilePath);
        float widthTo_Trim =         iTextSharp.text.Utilities.MillimetersToPoints(5);

16
2015
10

C# Crop PDF File

 

   static void cropiTxtSharp()
   {
        string file ="C:\\testpdf.pdf";
        string oldchar = "testpdf.pdf";
        string repChar = "test.pdf";
        PdfReader reader = new PdfReader(file);
        PdfDictionary pageDict;
        PdfRectangle rect = new PdfRectangle(0, 1000, 600, 115);
        pageDict = reader.GetPageN(1);
        pageDict.Put(PdfName.CROPBOX, rect);
        PdfStamper stamper = new PdfStamper(reader, new FileStream(file.Replace(oldchar, repChar), FileMode.Create, FileAccess.Write));
        stamper.Close();
        reader.Close();
    }

15
2015
10

js 点击按钮实现“隐藏,稍后弹出提示”的功能

 

右下角的信息弹出后,点击按钮实现 隐藏,稍后提示功能


        //隐藏, 稍后提示
        function hidelater(divId) {
            document.getElementById(divId).style.display = "none";
            setTimeout(function () { document.getElementById(divId).style.display = "block"; }, 10000);
        }

15
2015
10

js 获取 Request传递的值

 



 // js 获取 Request传递的值
        function request(strParame) {
            var args = new Object();
            var query = location.search.substring(1);

14
2015
10

art.dialog.close 关掉指定弹窗

 


在弹窗前,先给定义一个ID 例如:id='abc'

29
2015
09

C# 如何获取磁盘空间大小

 

利用System.IO.DriveInfo.GetDrives方法来获取

        /// 获取指定驱动器的空间总大小(单位为B)
        ///  只需输入代表驱动器的字母即可 (大写)
        public static long GetHardDiskSpace(string str_HardDiskName)
        {
            long totalSize= new long();
            str_HardDiskName=str_HardDiskName +":\\\\";

23
2015
09

RadGrid控件行合并功能实现(merge rows)

 

<telerik:RadGrid ID="RadGrid1" runat="server"
    OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender">
</telerik:RadGrid>


22
2015
09

JS编码和Asp.net编码转换

 

网页中经常会出现乱码问题,比如保存的中文文件名称下载下来是乱码,一般这样的问题,重新编码即可。


JS编码

1.window.escape()与HttpUtility.UrlEncodeUnicode()编码格式一样:将一个汉字编码为%uxxxx格式
不会被window.escape编码的字符有:@ _ - . * / +  这与http://www.w3school.com.cn/js/jsref_escape.asp上的解释不符合