views:

39

answers:

1

Hi, im creating temporary files to be stored in the Temp folder found by:

string path = System.IO.Path.GetTempPath() method returns C:\windows\Temp\

i append my filename:

string filename = myfile.txt
System.IO.Path.Combine(path,filename)

However, this gives me a

"Message":"The given path\u0027s format is not supported.","StackTrace":" at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)\r\n at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)\r\n at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)\r\n at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, AccessControlActions...... and so on

I have tried modifying the rights to the TEMP folder, so that NETWORK SERVICES has rights.. Any ideas?

+1  A: 

Your path contains an invalid character. Unicode code is 0027 which is a single quote "'" so you need to check where you are adding a single quote to the path.

Aliostad
Correct! Was a Date.Now() with minutes and hour that did the damage! Solved now! Thanks alot
matskn