C# MVC项目敏感信息存储与安全配置实践
2026/10/28 10:57:17
当程序从墓碑状态恢复时,会执行反向的处理流程。以相关代码为例:
protected override void OnNavigatedTo(NavigationEventArgs args) { object objHaveValidTileImages; if (appService.State.TryGetValue("haveValidTileImages", out objHaveValidTileImages) && (bool)objHaveValidTileImages) { emptyRow = (int)appService.State["emptyRow"]; emptyCol = (int)appService.State["emptyCol"]; for (int row = 0; row < VERT_TILES; row++) for (int col = 0; col < HORZ_TILES; col++) if (col != emptyCol || row != emptyRow) { byte[] buffer = (byte[])appService.State[TileKey(row, col)]; MemoryStream stream = new