Am trying to delete the temp files via C#. But it throws system.UnauthorizedAccessException.
File.Delete(Path.GetTempPath());
How can i fix that issue
You are using the System.IO.File.Delete(String) method which is intended to delete files, but you are passing a directory path as argument.
To delete a directory tree, you need to use System.IO.Directory.Delete(String, Boolean) method.
http://msdn.microsoft.com/en-us/library/62t64db3%28v=vs.110%29.aspx
Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
Anyways, note that some specific temporal files could still be in use by your application or other applications then you will not have access to delete in-use files, so maybe you will preffer to iterate the directory files then call the proper method to delete each found item, with a try/catch block.