示例#1
0
 public static void CreateFolderFromFilePath(string filePath)
 {
     if (!File.Exists(filePath))
     {
         Directory.CreateDirectory(UFile.GetFolder(filePath));
     }
 }
示例#2
0
 public static void OpenContainingFolder(string filePath)
 {
     try
     {
         Process.Start("explorer select,", filePath);
     }
     catch
     {
         Open(UFile.GetFolder(filePath));
     }
 }
示例#3
0
        private void Save()
        {
            if (BeforeSave != null)
            {
                BeforeSave(this, EventArgs.Empty);
            }

            bs.Visible = bc.Visible = false;
            be.Visible = bd.Visible = true;
            fu.Visible = false;

            if (PostedFileName != "")
            {
                string path = UWeb.MapPath(Url);

                if (path == "")
                {
                    path = UrlFolder;
                }
                {
                    UFile.Delete(path);
                }

                if (!RetainFileNameInEdit)
                {
                    path = UFile.GetFolder(path) + PostedFileName;
                }

                SaveAs(path);
            }

            SetValue(Url, ToolTip);

            if (AfterSave != null)
            {
                AfterSave(this, EventArgs.Empty);
            }
        }
示例#4
0
 public static void Unzip(string zipFilePath, bool deleteZipFile)
 {
     Unzip(zipFilePath, UFile.GetFolder(zipFilePath), "", deleteZipFile);
 }