开发者

Can I use %PUBLIC% and other "special" folders on Azure?

I need to migrate a huge application to Windows Azure. The application uses SHGetSpecialFolderLocation() and related WinAPI functions to obtain path to "special folders" like 开发者_StackOverflow社区%PUBLIC% ("c:\Users\Public\" by default on Windows 2008) and later stores stuff in that folder.

Can such special folders be accessed on Windows Azure?


You can definitely use the API and it will work just like normal Windows. The API is not the issue, but rather what you do with it that could be an issue. Unless you have a startup task or some other way to persist any changes that you write to these locations, they will be lost at the next service healing. For instance, if you asked for %SYSTEMROOT%, you would get "D:\Windows" in Windows Azure. That is great except when you go ahead and write a file you expect to persist into this location. The same thing goes to changes to the registry. The only way you can depend on these changes is to do it within a Startup task or some other mechanism to make sure that even after a service healing you would be back in the same state.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜