IBM.Data.DB2.iSeries 登录到 DB2 - 禁用 IBM 登录 Window

IBM.Data.DB2.iSeries Login to DB2 - Disable IBM Login Window

我正在使用 IBM.Data。DB2.iSeries.dll 连接到 IBM DB2 数据库。

工作正常,连接打开,可以进行所有操作。 但是当您启动 conn.open() 方法时,IBM 会向用户发送一个警告 - window,他的密码已过期。我想这个 window 直接来自客户端访问。

class Program
{
    static void Main(string[] args)
    {
        string connString = "DataSource=SYSTEM;UserID=USER;Password=PASSWORD";
        iDB2Connection conn = new iDB2Connection(connString);
        conn.Open();
    }
}

我找到了这个帖子:JT400.jar Disable Login Screen 以及如何使用 jt400.jar 禁用此行为,但与 IBM.Data.DB2.iSeries.dll.[=16 无关=]

是否有任何可能的方法在 C# 中隐藏或阻止此 window?

以下 IBM 支持文章建议使用 System i Navigator 设置 "prompting behaviour"。你可以试试看看有没有帮助。

http://www-01.ibm.com/support/docview.wss?uid=nas8N1017433

To change user ID and password prompting behavior within Access for Windows is through the Navigator, do the following: 1. Open the System i Navigator. 2. Right-click on the System name. and click on Properties. 3. Click on the connection tab, and select one of the following options:

o Specify Prompt every time. This prompts for a password every time a connection is made to the operating system.

o Specify Use default user id/password prompt, as needed. This prompts for an initial signon and does not prompt again during a Microsoft® Windows® session.

o Specify Use windows user id/password (never prompt). This does not prompt for a user ID or password and uses the Windows logon to sign on the operating system.

o Specify Use Kerberos. This will use the Windows Kerberos ticket for authorization and requires EIM setup on the operating system.

您是否正确安装了 Navigator?

有一篇关于 OLE DB 连接字符串的 IBM 支持文章。 .Net 连接字符串属性可能相似。但是,即使在这里也没有关于从应用程序中抑制对话框的详细信息。

OLE DB 连接属性: http://www-01.ibm.com/support/docview.wss?uid=nas8N1017400

The following list contains all of the custom properties that are available for the OLE DB providers shipped with iSeries Access for Windows (IBMDA400, IBMDARLA, and IBMDASQL). The release at which each property was added is indicated. For more information about any of these properties, consult the OLE DB technical reference that can be found in the Programmer's Toolkit included with iSeries Access for Windows.