Use FileSystem.DeleteFile and specify the right RecycleOption.
While this will work with UI Interactive Apps, it will not work with non UI interactive apps like a Windows Service app.
More Related Contents:
- Execute non-query error [closed]
- Why does Property Set throw StackOverflow exception?
- Double to string conversion without scientific notation
- What are attributes in .NET?
- Requested registry access is not allowed
- Calling async methods from a WCF service
- Getting / setting file owner in C#
- Unit testing and checking private variable value
- How to speed up the build and run process in unity for mobile devices iOS/Android [closed]
- get line number for XElement here
- “Strange” C# property syntax
- Do interfaces derive from System.Object? C# spec says yes, Eric says no, reality says no
- The Controls collection cannot be modified because the control contains code blocks (i.e. )
- How to get the selected item of a combo box to a string variable in c#
- C# : Converting Base Class to Child Class
- Can you keep a StreamReader from disposing the underlying stream?
- Binding an enum to a WinForms combo box, and then setting it
- Convert Transparent PNG to JPG with Non-Black Background Color
- ASP.NET Identity change password
- Why does my .NET application crash when run from a network drive?
- What is a good way to shutdown Threads blocked on NamedPipeServer#WaitForConnection?
- How do I get a rainbow color gradient in C#?
- How to deactivate “right click” on WPF Webbrowser Control?
- itextsharp – CSS not getting applied – C# .NET
- Download File From SharePoint 365
- Cast IList to List
- SSLStream example – how do I get certificates that work?
- C# 6.0 Null Propagation Operator & Property Assignment
- Add new metadata properties to a file
- DataContractJsonSerializer – Deserializing DateTime within List