我知道我们可以使用WPConnect工具从WP7设备获取离线日志。但我忘记了命令,也忘记了我从哪里学到的网站地址。有人知道这些命令是什么吗。我有以下代码来记录离线异常,但我不知道如何检索日志文件。请帮帮忙。
#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
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
}
#endregion发布于 2012-12-12 18:10:08
你是在说这个吗:Error Reporting on Windows Phone (Little Watson)
https://stackoverflow.com/questions/13836302
复制相似问题