kazelee
3 天以前 2aa6ffae020b4dab66ac30ee4436346aa15ff3cb
device/SnapManager.cs
@@ -22,10 +22,11 @@
            // SNAP
            DateTime now = DateTime.Now;
            string path = Settings.CaptureUrl;
            string fileName = string.Format("{0}{1}{2}{3}{4}{5}", now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second) + ".jpg";
            //string path = Settings.CaptureUrl;
            string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"StaticStorage/image/{now.Year}/{now.Month}/{now.Day}");
            string fileName = string.Format("{0}-{1}-{2}-{3}{4}{5}", now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second) + ".jpg";
            string filePath = path + "\\" + fileName;
            string url = Path.Combine(Settings.WebApiUrl, $"static/image/{now.Year}/{now.Month}/{now.Day}", fileName);
            //// 获取当前时间
            //DateTime now = DateTime.Now;
@@ -42,13 +43,16 @@
            //string filePath = Path.Combine(directoryPath, fileName);
            if (_snapDevice.SnapPictureToFileOK(ref filePath)) {
                return filePath;
                //return filePath;
                return url;
            }
            else {
                return string.Empty;
            }
        }
        // 大概率用不到,应该不是本地抓图,只可能是网络抓图,图片保存到后台
        public static string GetCapturePictureLocal() {
            return _snapDevice.GetCapturePictureLocalPath();
        }