andrew4582

GenerateETag

Mar 4th, 2012
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1. static string GenerateETag(DateTime lastModified,DateTime now) {
  2.         long num = lastModified.ToFileTime();
  3.         long num2 = now.ToFileTime();
  4.         string str = num.ToString("X8",CultureInfo.InvariantCulture);
  5.         if((num2 - num) <= 0x1c9c380L) {
  6.             return ("W/\"" + str + "\"");
  7.         }
  8.         return ("\"" + str + "\"");
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment