DBReader/Classes/Logon

/**
*
* DBReader 1.0, Access to SAP tables using SAP's .Net Connector.
*
* Author: hardteck
* Email: hardteck@web.de
*
* Last modified: Fr, 17. Okt 2003, 11:31:32
*/
namespace SAPReader {
using System;
///
/// The Logon encapsulates the SAPLogon.
///
///
public class Logon : SAP.Connector.SAPLogonDestination {
///
/// The Constructor.
///
public Logon(){}
///
/// Given the name of an SAP System, this method returns
/// the corresponding destination object.
///
///
/// Name of the SAP System as displayed in the list
/// of available destinations.
///
///
public SAP.Connector.Destination getDestinationByName(string name){
// Map the name used for displaying the available destination,
// e.g. at SAPLogon, to the internal name used to address this item.
// BTW, the internal name (key) is derived from saplogon.ini.
string destName = this.GetDestinationNameFromPrintName(name);
// null returned if the destination does not exist.
if(destName == null || destName == "" ){
Console.WriteLine(this.GetType().ToString()
+ ".getDestinationByName: Destination " + name + " does not exist."
);
Console.WriteLine("Available Destinations are: ");
this.printAvailableDestinations(Console.Out);
Environment.Exit(0);
}
// This is the key statement for selecting the desired destination item:
this.DestinationName = destName;
// Now all information is retrieved from the SAPLogon's ini file
// to the respective variables of 'this' destination object.
// (The ini file is stored in the private variable:
// SAP.Connector.SAPLogonDestination.saplogon.fileName)

return (SAP.Connector.Destination)this;
}
///
/// Writes a list of available destinations to a stream.
///
/// Stream to write to.
public void printAvailableDestinations(System.IO.TextWriter txtWriter){
foreach(System.Collections.DictionaryEntry dest in this.AvailableDestinations){
txtWriter.WriteLine(dest.Value.ToString());
}
}
}
}

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/232040/viewspace-968998/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/232040/viewspace-968998/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值