I'm developing an application, and I need to return the paths of files that have the same name and same extension from within a specific folder, to assign a version there, but I do not know any method to take as a basis. Basically, I would have to look in the project's home directory for the files named Assemblyinfo.cs, and throw those paths into an array, but I do not know how to do the query. Resolved by: dcastro
var files = Directory.GetFiles("C://caminho_de_amostra", "AssemblyInfo.cs", SearchOption.AllDirectories);
//Pesquisa no caminho atribuido o nome "Assemblyinfo.cs"
for (int h = 0; h < files.Length; h++)
{
Console.WriteLine(files[h]);// Apenas para ter um texto mostrando qual arquivo foi modificado
File.WriteAllLines(files[h], File.ReadAllLines(files[h]).Select(s => !s.Trim().StartsWith("[assembly: AssemblyFileVersion(") ? s : string.Join(".", s.Trim(']').Trim(')').Trim('"').Split('.').Select((n, i) => i != 3 ? n : !int.TryParse(n, out num) ? n : (anum))) + "\")]"));
}// Modifica a versão arquivo por arquivo.