コード例 #1
0
        static void _SaveModifiedTime(string filepath, string gmTime)
        {
            FileInfo fi;

            try
            {
                fi = new FileInfo(filepath);
                fi.LastWriteTime = GMTHelper.GMT2Local(gmTime);
            }
            catch (Exception ex)
            {
                Log.Exception("FiddlerRules", ex, "在保存文件修改时间时发生异常。");
            }
        }
コード例 #2
0
        static void _SaveModifiedTime(string filepath, string gmTime)
        {
            FileInfo fi;

            try
            {
                fi = new FileInfo(filepath);
                fi.LastWriteTime = GMTHelper.GMT2Local(gmTime);
            }
            catch (Exception ex)
            {
                Log.Exception("FiddlerRules", ex, "An error occured while saving file metadata");
            }
        }
コード例 #3
0
        static string _GetModifiedTime(string filepath)
        {
            FileInfo fi;

            try
            {
                fi = new FileInfo(filepath);
                return(GMTHelper.ToGMTString(fi.LastWriteTime));
            }
            catch (Exception ex)
            {
                Log.Exception("FiddlerRules", ex, "在保存文件修改时间时发生异常。");
                return("");
            }
        }
コード例 #4
0
        static string _GetModifiedTime(string filepath)
        {
            FileInfo fi;

            try
            {
                fi = new FileInfo(filepath);
                return(GMTHelper.ToGMTString(fi.LastWriteTime));
            }
            catch (Exception ex)
            {
                Log.Exception("FiddlerRules", ex, "An error occured while saving file metadata");
                return("");
            }
        }
コード例 #5
0
 static void _CreateResponseHeader(Session oSession, string filename)
 {
     oSession.oResponse.headers["Server"]        = "Apache";
     oSession.oResponse.headers["Cache-Control"] = "max-age=18000, public";
     oSession.oResponse.headers["Date"]          = GMTHelper.ToGMTString(DateTime.Now);
     oSession.oResponse.headers["Connection"]    = "close";
     oSession.oResponse.headers["Accept-Ranges"] = "bytes";
     filename.ToLower();
     if (filename.EndsWith(".swf"))
     {
         oSession.oResponse.headers["Content-Type"] = "application/x-shockwave-flash";
     }
     else if (filename.EndsWith(".mp3"))
     {
         oSession.oResponse.headers["Content-Type"] = "audio/mpeg";
     }
     else if (filename.EndsWith(".png"))
     {
         oSession.oResponse.headers["Content-Type"] = "image/png";
     }
 }