Follow the code below:
public static string pathname = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory.ToString()) + @"\Arquivo_Principal";
if (!File.Exists($@"{pathname}\Musica\{nomemusica}.txt"))
{
File.WriteAllText($@"{pathname}\Musica\{nomemusica}.txt", letramusica, Encoding.UTF8);
}
Any solution?