开发者

How to access files from within a cloud web service?

How do you access local files from within a windows azure web service? I tried routing the complete path to the file within VS but it says that access is denied. I was hoping there was something similar to Server.MapPath() in ASP.NET but I haven't come accross anything 开发者_如何学编程like that yet. Also I am running VS in Administrator mode. Any ideas?

NOTE: I am using a WCF Service (A cloud project in VS)


Things are different in Azure. Basically you need to indicate and set up local storage usage in the service definition file for your role. There is Local Storage section in the role properties. Once setup, you can access the local storage in your code by calling RoleEnvironment.GetLocalResource and passing in the local storage name. You can then read from and write to that local storage. Below are some blogposts on the topic.

  • Windows Azure Local File Storage - How To Guide and Warnings
  • Learning Azure Local Storage with me
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜