ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved.Create folder inside bin directory using C# in ASP.Net<p>Hi <a class="username" rel="amitsinghr"> amitsinghr</a>,<br /><br />The folders inside the bin folder of your project are always deleted when you clean / rebuild your solution.<br /><br />The simplest way of doing it is by adding the desired folder to your project.</p>, 18 Sep 2017 06:25:51 GMTCreate folder inside bin directory using C# in ASP.Net<p>&nbsp;</p> <pre class="brush: csharp"> private void LogService(string content) { string path = AppDomain.CurrentDomain.BaseDirectory.Substring(0, AppDomain.CurrentDomain.BaseDirectory.Substring(0, AppDomain.CurrentDomain.BaseDirectory.LastIndexOf(&#39;\\&#39;)).LastIndexOf(&#39;\\&#39;)) + &#34;\\ServiceLog&#34;; if (!Directory.Exists(path)) { DirectoryInfo di = Directory.CreateDirectory(path); } string filePath = path + &#34;\\log&#34; + DateTime.Now.ToString(&#34;ddMMyyyy&#34;) + &#34;.txt&#34;; using (FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)) { using (StreamWriter sw = new StreamWriter(fs)) { sw.BaseStream.Seek(0, SeekOrigin.End); sw.WriteLine(content); sw.Flush(); sw.Close(); } } }</pre> <p>&nbsp;</p>, 20 Sep 2017 02:04:34 GMT