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, "在保存文件修改时间时发生异常。"); } }
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"); } }
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(""); } }
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(""); } }
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"; } }