HateBSOD,
The static GetFileName method on the Path class doesn't find files given
a wildcard string. Rather, it takes the file part of the path, and returns
that.
If you want to find files, I don't believe there is a managed code
method you can use. However, you can call the FindFirstFileEx function
through the P/Invoke layer.
Once you find your files, you can use the classes in the
System.Security.Cryptography namespace to encrypt the file, and the classes
in the System.IO namespace (specifically the FileStream class) to write the
new file.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"HateBSOD" <h8*****@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Say I want to get the file name of C:\temp\something.xml and have that
put into a variable so I can encrypt the file and output it to
c:\temp\filename.enc. I have not found anything that solves this for
me.
I tired this
static void Main(string[] args)
{
string fileName = @("C:\","*.xml");
string path = @"C:\*.xml";
string result;
result = Path.GetFileName(fileName);
but that has to be static. Any help is appreciated.