用于配置文件选择的C#nameSpace.Logon(" NewProfile1","",false,false)提示 [英] C# nameSpace.Logon("NewProfile1", "", false, false) prompt for profile selection

查看:93
本文介绍了用于配置文件选择的C#nameSpace.Logon(" NewProfile1","",false,false)提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C#来枚举来自特定Outlook配置文件的PST文件,这必须在用户登录时完成,现在我正在尝试使用:

I am using C# to enumerate PST files from specific Outlook profile, this has to be done at user logon, now I am trying to use:

nameSpace.Logon("NewProfile1"""falsefalse);

但它会提示用户选择个人资料,但不会登录个人资料"NewProfile1"。虽然它存在但有什么问题?!

but it prompts the user for profile selection and doesn't login to the profile "NewProfile1" although it exists, what is wrong ?!

Mahmoud Magdy - Exchange Server MVP

Mahmoud Magdy - Exchange Server MVP

推荐答案

Outlook是否设置为在启动时提示配置文件? Outlook是否正在运行?

Is Outlook set to prompt for the profile on start-up? Is Outlook running at the time?

请记住,PST路径存储在配置文件部分数据中,因此理论上您需要做的就是从注册表中读取相应的数据。

Keep in in mind that PST paths are stored in the profile section data, so in theory all you need to do is read the appropriate data from the registry.

官方支持的方式是通过  IProfAdmin
界面(C ++或Delphi) - 您需要打开"MSPST MS"。和"MSUPST MS"和"MSUPST MS"。提供程序配置文件部分并读取PR_PST_PATH属性。你可以在
OutlookSpy 中点击它(点击IProfAdmin按钮)。

The officially supported way of doing that is through the IProfAdmin interface (C++ or Delphi) - you will need to open the "MSPST MS" and "MSUPST MS" provider profile sections and read the PR_PST_PATH property. You can play with that in OutlookSpy (click IProfAdmin button).

如果不能选择C ++或Delphi,请
ProfMan
(随附
赎回
)会让你这样做:

If C++ or Delphi are not an option, ProfMan (comes with the distributable version of Redemption) would let you do just that:

'Print the path to all the PST files in all profiles
 PR_PST_PATH = &H6700001E
 set Profiles=CreateObject("ProfMan.Profiles")
 for i = 1 to Profiles.Count
   set Profile = Profiles.Item(i)
   set Services = Profile.Services
   Debug.Print "------ Profile: " & Profile.Name & " ------"
   for j = 1 to Services.Count
     set Service = Services.Item(j)
     If (Service.ServiceName = "MSPST MS") or(Service.ServiceName = "MSUPST MS") Then
      'there should be only one provider for this service
       'but we should really loop through all the providers
      Debug.Print Service.Providers.Item(1).ProfSect.Item(PR_PST_PATH)
    End If
   next
 next


这篇关于用于配置文件选择的C#nameSpace.Logon(" NewProfile1","",false,false)提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆