Guest User

Untitled

a guest
May 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. private async void Submit1_ServerClick(object sender, EventArgs e)
  2. {
  3. string fn = Path.GetFileName(File1.PostedFile.FileName);
  4. string SaveLocation = Server.MapPath("Data") + "\" + fn;
  5. if (!File.Exists(SaveLocation))
  6. {
  7. File1.PostedFile.SaveAs(SaveLocation);
  8. await Task.Run(() => Program.Main());
  9. //IAsyncResult result = Task.Run(() =>caller.BeginInvoke(null, null));
  10. //caller.EndInvoke(result);
  11. Response.Write("The file has been uploaded and the Estimated Values should now be reflected in Rally.");
  12. }
  13. else
  14. {
  15. File.Delete(SaveLocation);
  16. File1.PostedFile.SaveAs(SaveLocation);
  17. await Task.Run(() => Program.Main());
  18. //IAsyncResult result = Task.Run(() => caller.BeginInvoke(null, null));
  19. //caller.EndInvoke(result);
  20. Response.Write("The file has been uploaded and the Estimated Values should now be reflected in Rally.");
  21. }
  22. }
Add Comment
Please, Sign In to add comment