title: Append path to string
body: <p>I need help in appeding the string to path. The problem here is that the path that i have declare cannot be call, instead it just give normal string value. here is my code.</p>
  
  <pre><code>public static string inputhistory1 = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) + "\\Log\\" + Process.GetCurrentProcess().ProcessName + DateTime.Now.ToString("yyyyMMdd")+".chf";
  public static string inputhistory2 = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) + "\\Log\\FileExtact" + DateTime.Now.AddMonths(-1).ToString("yyyyMM") + ".chf";
  public static string inputhistory3 = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) + "\\Log\\FileExtact" + DateTime.Now.AddMonths(-2).ToString("yyyyMM") + ".chf";
  public static string inputhistory4 = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) + "\\Log\\FileExtact" + DateTime.Now.AddMonths(-3).ToString("yyyyMM") + ".chf";
  
  public static bool checkfile(string filename)
  {
      bool same = false;
  
      for (i = 1; i &lt;= 4; i++)
      {
          string filechf = "inputhistory" + i;
          filechf = filechf;
  
          try
          {
              foreach (string line in System.IO.File.ReadAllLines(filechf))
              {
                  if (line.Contains(filename))
                  {
                      same = true;
                      break;
                  }
                  else
                  {
                      same = false;
                  }
  
                  }
              }
  
          catch (Exception)
          {
              // Ignore if file does not exist.
          }
  
          if (same == true)
          {
              break;
          }
      }
  }
  </code></pre>