Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何检查是否已使用SAP.net coonector建立连接_C#_Asp.net_Saprfc_Sap Dotnet Connector - Fatal编程技术网

C# 如何检查是否已使用SAP.net coonector建立连接

C# 如何检查是否已使用SAP.net coonector建立连接,c#,asp.net,saprfc,sap-dotnet-connector,C#,Asp.net,Saprfc,Sap Dotnet Connector,我正在尝试连接到我的客户SAP系统。我正在使用以下代码进行连接,但是我如何知道连接已成功建立 protected void Page_Load(object sender, EventArgs e) { try { SAPSystemConnect sapCfg = new SAPSystemConnect(); RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);

我正在尝试连接到我的客户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;
    }
}

如果连接没有抛出异常,您将知道连接已经建立。如果连接有问题,该类将抛出一个适当的异常。

我对此进行了调试,没有收到任何错误。但是当我写这行rfcDest.Ping()时;我收到连接超时错误。可能SAP服务器上已禁用Ping