你可以刪除存儲在HttpContext.Current.Application["variable"]
中的值嗎?或者唯一的方法是將其設置爲空字符串?你可以刪除存儲在HttpContext.Current.Application [「variable」]中的值嗎?
3
A
回答
6
您可以使用Application.Remove
,Application.RemoveAll
和Application.RemoveAt
方法。
2
使用
HttpContext.Current.Application.Remove("variable");
此外,設置null
是好的,因爲如果你嘗試讀取HttpContext.Current.Application["variable"]
並沒有價值在那裏,它將返回null
無論如何,但當然更好,如果你想要什麼明確是刪除。
2
HttpContext.Current.Application.Remove(...)
相關問題
- 1. 使用HttpContext.Current.Application存儲值
- 2. 在PhotoKit中刪除:你可以跳過「最近刪除」嗎?
- 3. 你可以在int變量中存儲/轉換int值嗎?
- 4. 你可以用節點刪除system32嗎?
- 5. 你可以刪除appengine項目嗎?
- 6. 你可以加入存儲過程嗎?
- 7. 你可以在WHERE IN(SELECT @var)中使用mysql @variable嗎?
- 8. 我可以從mercurial-server中刪除存儲庫嗎?
- 9. 你可以在if子句中存儲一個變量嗎?
- 10. 你可以在Memcache中存儲PHP數組嗎?
- 11. 你可以存儲表在T-SQL語句中重用嗎?
- 12. Android - 你能解釋爲什麼你可以刪除代碼嗎?
- 13. 整個聲明是否可以存儲爲@variable值Less?
- 14. 你可以刪除sublime text2中的一系列行嗎?
- 15. 你可以刪除SQLite數據庫中的列嗎?
- 16. 你可以緩存UIViewControllers嗎?
- 17. 你可以緩存JNIEnv嗎?
- 18. 可以刪除Git存儲,可以刪除工作目錄中的文件夾嗎?
- 19. Swift:你可以將函數作爲值存儲在字典中嗎?
- 20. Cookie可以存儲但不能刪除
- 21. 你可以加載存儲過程中的nhibernate實體嗎?
- 22. 你可以存儲Facebook的喜歡在MySQL嗎?
- 23. 我可以使用edit()刪除值嗎?
- 24. 你可以從UIDatePicker中刪除時間嗎?
- 25. 使用HttpContext.Current.Application存儲簡單數據
- 26. session_register可以存儲多個值嗎?
- 27. 我可以在Windows Azure表存儲中刪除整個分區嗎?
- 28. 我可以在RSpec中存儲STDERR嗎?
- 29. 我可以刪除maven的.m2存儲庫中的.pom和.lastUpdated文件嗎?
- 30. 你可以通過API刪除Facebook牆貼上的「Via _Application_」嗎?