Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 WPF 页面关闭时立即释放所有占用的内存
请指导我
如果你想确定,你可以处理关闭事件。
<Window Closing="Window_Closing">
接着:
private void Window_Closing(object sender, CancelEventArgs e) { //Free resources, close files, sockets, connections, etc. //Calling Dispose method where possible }
希望有所帮助!