Advertisement
Guest User

Untitled

a guest
May 29th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1.                     else if (urlParts[0] == "pc")
  2.                     {
  3.                         var file = "pc/" + urlParts[1];
  4.  
  5.                         if (urlParts[1] == "mp_playlists.txt")
  6.                         {
  7.                             var stream = File.OpenRead(file);
  8.                             rp.fs = stream;
  9.                             rp.Headers["Content-Type"] = "application/octet-stream";
  10.                             rp.status = (int)RespState.OK;
  11.                         }
  12.                         else if (urlParts[1] == "mp_playlists.ff")
  13.                         {
  14.                             var stream = File.OpenRead(file);
  15.                             rp.fs = stream;
  16.                             rp.Headers["Content-Type"] = "application/octet-stream";
  17.                             rp.status = (int)RespState.OK;
  18.                         }
  19.                         else
  20.                         {
  21.                             rp.status = (int)RespState.NOT_FOUND;
  22.                             rp.Headers["Content-Type"] = "text/plain";
  23.                             rp.BodyData = Encoding.ASCII.GetBytes("Not Found");
  24.                         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement