title: Code not creating a text file C#
body: <p>I am trying to create a program that checks if the following file exists and if not, create one and write name to it. But the program doesn't create a file and doesn't throw any exceptions. </p>
  
  <pre><code>        string verify;
          string name = textBox1.Text;
          string path = Path.Combine(@"C:\assets\"+ name + ".txt");
          if (!File.Exists(path))
          {
              File.Create(path);
              File.WriteAllText(path, name);
          }
          else if (File.Exists(path))
          {
              verify = File.ReadAllText(path);
              if (verify == name)
              {
                  return;
              }
          }
  </code></pre>