Dynamique Path

hello every body,

I need to write File in Path directory, i did it for one directory, but not for others directory , because the path changes ,so it’s possible in Axpta , to use dynamique Path, like %UserProfile%/ in windows.

Plz Help.

Many Thanks

Taoufiq

You can use paths in the usual way and replace variables by values like in the following example:

System.Environment::ExpandEnvironmentVariables(@'%UserProfile%\test.txt');

In fact , i wante write the file in a directory using the path , but the path change according the user , i use this syntax :

System.IO.FileStream fs;#### fs = System.IO.File::Create(System.Environment::ExpandEnvironmentVariables(@"%UserProfile%\Documents\File.pdf");

fs.Write(no,0,bytear.get_Length());

But i seems thers is error, cany you help.

Thanks for your replying Martin.

Thanks

Taoufiq

Thanks it 'works now.

Taoufiq