Is there a class to wrap blob storage to map to a dirver or net share?

답변됨 Is there a class to wrap blob storage to map to a dirver or net share?

  • 2012년 4월 30일 월요일 오전 2:24
     
     

    A lot of existing dll support loading from file system, like

      MailMessage mm=new MailMessage();

      mm.Load("c:\\test.eml");

    just an example, if I port that to Azure, I have a test.eml under one containder, it will be handy if I can map the test.eml to something like \\dummy\test.eml, and call the class to load it. Is it possible?

모든 응답

  • 2012년 4월 30일 월요일 오전 6:37
    중재자
     
     

    Hi,

    Do you want to use tranditional IO class and methods in Windows Azure Platform? I'd like to suggest you use Drive as the storage, Azure Drive is used to provide a NTFS formatted VHD file (Page Blob) that you can use file system class to handle the target files with tranditional methods, such as Load(string path) method. Refer to following link for more details and sample code of Drive:

    http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_exploringwindowsazurestoragevs2010_topic5#_Toc310346241

    Hope this helps.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

  • 2012년 4월 30일 월요일 오후 5:28
     
     
    I only want to use traditional IO when I have to, for example, I have a class to read out and parse a PDF on disk, now the PDF is in my Azure, so I need a way to still use the class. I think the most straight way is mapping it to a virtual disk or a network share. Seems quite simple, just I don't know how to write the code.
  • 2012년 5월 1일 화요일 오전 2:20
    중재자
     
     답변됨

    Hi,

    I am not sure MailMessage.Load() method is your custom method? (or 3rd-party class library), .NET Framework does not include this method (http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx). If so, does it include other overload methods (with other type parameters). As you want to use Blob Storage, you have to change your code with Blob style API, you cannot simply use traditional IO API because they are not the same architecture.

    The workaround i can figure out is that if you have a MainMessage.load(Stream stream) override method, you can download the blob from Blob API and convert files as the stream parameter of Load method.

    Hope this helps.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework