首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用WPConnect从wp7获取离线日志的命令?

使用WPConnect从wp7获取离线日志的命令?
EN

Stack Overflow用户
提问于 2012-12-12 17:10:07
回答 1查看 68关注 0票数 0

我知道我们可以使用WPConnect工具从WP7设备获取离线日志。但我忘记了命令,也忘记了我从哪里学到的网站地址。有人知道这些命令是什么吗。我有以下代码来记录离线异常,但我不知道如何检索日志文件。请帮帮忙。

代码语言:javascript
复制
  #region Offline Error Logger
    /// <summary>
    /// Logs Exception for the app when the device is not connected to the PC.This file can later be retrieved for the purpose of Bug fixing 
    /// </summary>
    /// <param name="strMsg">Exception message</param>
    private static void LogOffline(string strMsg)
    {

如果是LOG_ENABLED

代码语言:javascript
复制
        try
        {
            using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                string dirName = "SOSLog";
                string logFileName = "SOSLog.txt";
                string fullLogFileName = System.IO.Path.Combine(dirName, logFileName);
                // TODO: Synchronize this method with MainPage using Mutex
                string directoryName = System.IO.Path.GetDirectoryName(fullLogFileName);
                if (!string.IsNullOrEmpty(directoryName) && !myIsolatedStorage.DirectoryExists(directoryName))
                {
                    myIsolatedStorage.CreateDirectory(directoryName);
                    Debug.WriteLine("Created directory");
                }
                if (myIsolatedStorage.FileExists(fullLogFileName))
                {
                    using (IsolatedStorageFileStream fileStream =
                            myIsolatedStorage.OpenFile(fullLogFileName, FileMode.Append, FileAccess.Write))
                    {
                        using (StreamWriter writer = new StreamWriter(fileStream))
                        {
                            writer.WriteLine(strMsg);
                            writer.Close();
                        }
                    }
                }
                else
                {
                    using (IsolatedStorageFileStream fileStream =
                            myIsolatedStorage.OpenFile(fullLogFileName, FileMode.Create, FileAccess.Write))
                    {
                        using (StreamWriter writer = new StreamWriter(fileStream))
                        {
                            writer.WriteLine(strMsg);
                            writer.Close();
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Debug.WriteLine("Exception while logging: " + ex.StackTrace);
        }

endif

代码语言:javascript
复制
    }
    #endregion
EN

回答 1

Stack Overflow用户

发布于 2012-12-12 18:10:08

你是在说这个吗:Error Reporting on Windows Phone (Little Watson)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13836302

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档