string[] arquivos = Directory.GetFiles(@"C:\Teste_Zip\web", "*", SearchOption.AllDirectories);
The question is: I need to get the files, except in a folder. I could not get past the folder. The folder is Fixed, does not vary.
I did this and says that it is not possible to convert char to string []. The var files is an array of string.
private void button1_Click(object sender, EventArgs e)
{
string[] result = Path.GetFileNameWithoutExtension(arquivos.ToString());
}
All I need is to get the name of the files and the path of the files.
Here's how you solved it:
private void button1_Click(object sender, EventArgs e)
{
string s = string.Empty;
List<string> lista = new List<string>();
string path = ConfigurationSettings.AppSettings["Caminho_Base"];
string[] arquivos = Directory.GetFiles(path, "*", SearchOption.AllDirectories);
foreach(var item in arquivos)
{
s = Path.GetFileNameWithoutExtension(item);
if (!item.Contains("TSNMVC"))
lista.Add(s);
}
}