locked
How to read a file in c directory asynchronously in metro c#

    Question

  • Hi,

    I have to launch an xls file from the path :c:/inetpub/wwwroot asynchronously,

    I have done the following code but it throws an saying "its not trusted or it could be hidden"

    Could you pls help me out

    string imageFile = @"C:\inetpub\wwwroot\Data.xls";

    StorageFile file = awaitStorageFile.GetFileFromPathAsync(imageFile);


    if

    (file != null)

                   {



    // Launch the retrieved file



    var

    success = awaitWindows.System.Launcher.LaunchFileAsync(file);



    if

    (success)

                      {

     


    // File launched


     

                      }

     


    else


                      {

                      


    // File launch failed


     

                      }

                   }           

     


    else


                   {

                     


    // Could not find file


                   }

                }

    Friday, August 15, 2014 8:39 AM

Answers

All replies