Your code is running on the server. It is accessing folders on the server, not on the client.
It might
appear to work when you debug locally, but that's just because the server and client are the same machine in that specific instance.
Code running on the server cannot access files on the client. If you need the client to upload a file, then you have to give them a
<input type="file">
to select the file, and save the uploaded file somewhere on the server.
File Upload with ASP.NET[
^]