From 7ded9bc93b6beb5d7311ed4d013f90c521f85b5e Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 24 八月 2020 11:47:24 +0800 Subject: [PATCH] 2020.08.24.1 --- ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 38 +++++++++++++++++++++++++++++++------- 1 files changed, 31 insertions(+), 7 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs index c4ac51c..8907c8b 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs @@ -12,6 +12,7 @@ { public class Send { + #region ----Logic鎵�鏈夊彂閫佸懡浠� /// <summary> /// 鑾峰彇LogicId鐨勬柟娉� @@ -1324,6 +1325,22 @@ #endregion #region 瀛樺彇鏈湴鏂囦欢鐨勬柟娉� ---鏆傛椂涓嶇敤鍚堝苟璇ユ柟娉�--- + /// <summary> + /// 鍒ゆ柇鏄惁寮�鍚疓PS鏈嶅姟 + /// </summary> + public static string It_Exist + { + get + { + //璇诲彇鏈湴GPS鏈嶅姟鐘舵�� + if (ReadLocalFile("GPS_File") == "0") + { + return "0"; + } + return "1"; + } + + } /// <summary> /// 鏂囦欢淇濆瓨 /// </summary> @@ -1337,20 +1354,27 @@ var byteData = System.Text.Encoding.UTF8.GetBytes(data); //鍐欏叆鏁版嵁锛� Shared.IO.FileUtils.WriteFileByBytes(FileName, byteData); + } + /// <summary> + /// 鏂囦欢淇濆瓨 + /// </summary> + /// <param name="FileName">鏂囦欢璺緞</param> + /// <param name="data">瀛楃涓�</param> + public static void SaveLocalFile(string FileName, string data) + { + //鍏堝簭鍒楀寲鏁版嵁锛� + //鏁版嵁杞崲涓哄瓧鑺傛祦锛� + var byteData = System.Text.Encoding.UTF8.GetBytes(data); + //鍐欏叆鏁版嵁锛� + Shared.IO.FileUtils.WriteFileByBytes(FileName, byteData); } - /// <summary> /// 鏂囦欢璇诲彇 /// </summary> /// <param name="FileName">鏂囦欢璺緞</param> /// <returns></returns> public static string ReadLocalFile(string FileName) - { - if (System.IO.File.Exists(FileName) == false) - { - ///鍒ゆ柇鏄惁鏈夋枃浠�; - return null; - } + { //璇诲嚭淇濆瓨璇ヨ矾寰勭殑鏂囦欢锛� var varByte = Shared.IO.FileUtils.ReadFile(FileName); //瀛楄妭娴佽浆鎹负瀛楃涓诧紱 -- Gitblit v1.8.0