天天看點

Windows Phone 實用開發技巧(24):上傳日志

We can make a button that is used to let user to upload logs, use vdisk as destination. We can rename log files with time so that we can distinguish when the log file sent to our space. Here I built a demo app use vdisk and logging library to demonstrate how to upload log files to vdisk.

1. Create a new project named:mangoUploadLog, add essential libs to it

<a href="http://images.cnblogs.com/cnblogs_com/alexis/201110/201110102021153135.png"></a>

2.Edit App.xaml.cs, add some log in it. We log the lifecycle of the app

3.Edit MainPage.xaml, add a Button named ”Upload” to UI

<a href="http://images.cnblogs.com/cnblogs_com/alexis/201110/201110102021168858.png"></a>

4.Edit Upload Button Click event, add following code:

5. Test our app, run it and click upload, then login vdisk, you will find your log file there

    本文轉自xshf12345 51CTO部落格,原文連結:http://blog.51cto.com/alexis/684577,如需轉載請自行聯系原作者