|
|
@@ -3,6 +3,7 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.ComponentModel;
|
|
|
using System.Data;
|
|
|
+using System.IO;
|
|
|
using System.Net;
|
|
|
using System.Net.Sockets;
|
|
|
using System.Reflection;
|
|
|
@@ -204,6 +205,44 @@ namespace UAS_MES.PublicMethod
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取打印标签
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="labelName"></param>
|
|
|
+ /// <param name="labelUrl"></param>
|
|
|
+ /// <param name="indate"></param>
|
|
|
+ public static void GetPrintLabel(string labelName, string labelUrl, string indate)
|
|
|
+ {
|
|
|
+ string LabelUrl = labelUrl;
|
|
|
+ string LabelName = labelName;
|
|
|
+ System.DateTime time = Convert.ToDateTime(indate);
|
|
|
+ FileInfo file = new FileInfo(ftpOperater.DownLoadTo + LabelName);
|
|
|
+ if (time.ToString() != file.LastWriteTime.ToString())
|
|
|
+ BaseUtil.GetLabelUrl(LabelUrl, LabelName, time);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取标签的路径
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="URL"></param>
|
|
|
+ /// <param name="LabelName"></param>
|
|
|
+ /// <param name="time"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static string GetLabelUrl(string URL, string LabelName, DateTime time)
|
|
|
+ {
|
|
|
+ //如果是传入的数据是从FTP取的文件
|
|
|
+ if (URL.Contains("ftp:"))
|
|
|
+ {
|
|
|
+ ftpOperater ftp = new ftpOperater();
|
|
|
+ return ftp.Download(LabelName, time);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return URL;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 移除重复行
|
|
|
/// </summary>
|