以编程方式重置Outlook PST密码

时间:2017-10-10 14:53:12

标签: c# .net email outlook pst

我无法记住我的Outlook PST密码,并且无法将该文件导入Outlook 2016.我尝试了多个论坛,免费密码恢复软件工具,但无法重置/恢复密码。经过大量浏览后,我发现Aspose.Email .NET有一个后门来访问PST文件的属性,并且有一种重置密码的方法。我对此一无所知,从未使用.NETC#。有人可以帮助我吗?

以下是浏览结果中的相关链接:

Aspose.Email for .NET - https://dzone.com/articles/how-to-check-set-remove-or-update-password-of-pst

PST密码属性 - https://msdn.microsoft.com/en-us/library/ff385916(v=office.12).aspx

请注意我的PST是UNICODE而不是ANSI格式,因此以下内容已经不可能了。 http://www.itninja.com/blog/view/how-to-unlock-password-protected-pst-file-6

这就是我在网上试过的https://dotnetfiddle.net/

using System;
using Aspose.Email.Mapi;
using Aspose.Email.Storage.Pst;


namespace Aspose.Email.Examples.CSharp.Email.Outlook
{
    class RemovingPaswordProperty
    {
        public static void Run()
        {
            // The path to the File directory.
            // ExStart:RemovingPaswordProperty
            string dataDir = RunExamples.GetDataDir_Outlook();
            PersonalStorage personalStorage = PersonalStorage.FromFile(dataDir + "PersonalStorage1.pst");
            if (personalStorage.Store.Properties.ContainsKey(MapiPropertyTag.PR_PST_PASSWORD))
            {
                MapiProperty property = new MapiProperty(MapiPropertyTag.PR_PST_PASSWORD, BitConverter.GetBytes((long)0));
                personalStorage.Store.SetProperty(property);
            }
            // ExEnd:RemovingPaswordProperty
        }
    }
}

我收到了以下错误:

Error(s): Compilation error (line 14, col 30): The name 'RunExamples' does not exist in the current context

0 个答案:

没有答案