title: Read/Wrtite file in ASP.net when published with somee domain
body: <p>i have the problem that i need to access xml and xlxs file in a website code with asp.net. I have read and written well in local server but when i published to host. I can not access the folder in host server. Here is my code:</p>
  <pre><code>protected void CheckUsername(object sender, EventArgs e)
          {
              List&lt;User&gt; NewList = new List&lt;User&gt;();
              String _file = 
              ConfigurationManager.AppSettings[&quot;APPData3&quot;]; //C:/user.xml                                    
              if (!File.Exists(_file))
              {
                  throw new ArgumentException(&quot;No Data found&quot;);
              }
              var serializer = new XmlSerializer(typeof(List&lt;User&gt;));
              using (var reader = XmlReader.Create(_file))
              {
                  NewList = (List&lt;User&gt;)serializer.Deserialize(reader);
              }
              foreach (var item in NewList)
              {
                  if (Username.Text.ToString() == 
             item.Username.ToString() &amp;&amp; Password.Text.ToString() == 
              item.Password.ToString())
                  {
                      checking = true;
                  }
              }
              if (checking)
              {
                  Session[&quot;username&quot;] = Username.Text.ToString();
                  Response.Redirect(&quot;EditTable.aspx&quot;);
              }
              else
              {
                  Username.Text = &quot;Sai thông tin&quot;;
              }
              
          }
  </code></pre>
  <p>So, how could i access the folder after published to host (somee). Please help.</p>