title: How to know the path in System.Web.HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath)
body: <pre><code>strFilePath = System.Web.HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath)
  strFilePath = str + "ApInterface_" + Format(Now.Date, "dd-MMM-yyyy").Replace("-", "") + "_" + Format(Now, "HH:mm:ss").Replace(":", "") + ".dat"
  </code></pre>
  
  <p>I have the above code snippet where it saves the file in .dat extension in the specified folder. The problem for me is about the path. When I specify the path something like <strong>"D:\myfolder"</strong>, the data will be exported and file will be opened but it wont get saved. If I specify the folder as <strong>"D:\myfolder\"</strong> it saves perfectly, why do I need <code>"\"</code> and the end?</p>