using System;
using System.IO;
public class Test
{
public static void Main()
{
string texto =
@"Isto é um exemplo. E quero que na label1 apareceça o que está dentro de aspas.
Ou seja, o texto que se encontra ""aqui.txt"".
Porém a label1 não sabe o que estará na textbox.";
int valorPos = texto.IndexOf(@"""") + 1;
string valorEntreAspas = texto.Substring(valorPos, texto.IndexOf(@"""", valorPos) - valorPos);
string arquivoSemExtensao = Path.GetFileNameWithoutExtension(valorEntreAspas);
Console.WriteLine(arquivoSemExtensao); // aqui.txt
Console.ReadLine();
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uSU87CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkgIHN0cmluZyB0ZXh0byA9IAogICAgQCJJc3RvIMOpIHVtIGV4ZW1wbG8uIEUgcXVlcm8gcXVlIG5hIGxhYmVsMSBhcGFyZWNlw6dhIG8gcXVlIGVzdMOhIGRlbnRybyBkZSBhc3Bhcy4KICAgICAgT3Ugc2VqYSwgbyB0ZXh0byBxdWUgc2UgZW5jb250cmEgIiJhcXVpLnR4dCIiLiAKICAgICAgUG9yw6ltIGEgbGFiZWwxIG7Do28gc2FiZSBvIHF1ZSBlc3RhcsOhIG5hIHRleHRib3guIjsKICAgICAgCiAgICAgIGludCB2YWxvclBvcyA9IHRleHRvLkluZGV4T2YoQCIiIiIpICsgMTsKICAgICAgc3RyaW5nIHZhbG9yRW50cmVBc3BhcyA9IHRleHRvLlN1YnN0cmluZyh2YWxvclBvcywgdGV4dG8uSW5kZXhPZihAIiIiIiwgdmFsb3JQb3MpIC0gdmFsb3JQb3MpOwogICAgICBzdHJpbmcgYXJxdWl2b1NlbUV4dGVuc2FvID0gUGF0aC5HZXRGaWxlTmFtZVdpdGhvdXRFeHRlbnNpb24odmFsb3JFbnRyZUFzcGFzKTsKICAgICAgCiAgICAgIENvbnNvbGUuV3JpdGVMaW5lKGFycXVpdm9TZW1FeHRlbnNhbyk7IC8vIGFxdWkudHh0CiAgICAgIENvbnNvbGUuUmVhZExpbmUoKTsKCX0KfQ==