0

我正在尝试连接到我的客户 SAP 系统。我正在使用以下代码进行连接,但是我如何知道连接已成功建立。

protected void Page_Load(object sender, EventArgs e)
{
    try
    {
        SAPSystemConnect sapCfg = new SAPSystemConnect();
        RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);
        RfcDestination rfcDest = null;
        rfcDest = RfcDestinationManager.GetDestination("Dev");
    }
    catch (Exception ex)
    {
        lbl.Text=ex.Message;
    }
}
4

1 回答 1

1

如果连接没有抛出异常,你就知道连接已经建立了。如果连接出现问题,该类将抛出适当的异常。

于 2013-11-19T07:01:32.927 回答