For the record
Procedure 1:
public static bool InitLotusNotesSessionPDS()
{
try
{
bStatus = SetLoginUserPDS(PDS_SMS_Pgm_Main.PDSPromINIFilePath + "Spec.id"
if (bStatus == true)
{
bStatus = InitLNotesSessionPDS();
if (bStatus == true)
{
bStatus = SetLoginUserPDS(PDS_SMS_Pgm_Main.sCurrUserID
return true;
}
else { return false; }
}
else { return false; }
}
catch (Exception ex)
{ Console.WriteLine(ex.Message); return false; }
}
Procedure 2:
public static bool SetLoginUserPDS(string myNewUserID
{
try
{
string sNotesIniFile = "";
string INIFile = "PDS_and_Prom_Intfc.ini";
Aux_IniFile_Handler objINI = new Aux_IniFile_Handler();
objINI.Path = PDS_SMS_Pgm_Main.PDSPromINIFilePath + INIFile;
objINI.Section = "LOTUS_NOTES";
objINI.myDefault = "NOT AVAILABLE";
objINI.Key = "INI_FILE";
sNotesIniFile = objINI.myValue;
if (sNotesIniFile != "NOT AVAILABLE")
{
objINI.Path = sNotesIniFile;
objINI.Section = "Notes";
objINI.myDefault = "NOT AVAILABLE";
objINI.Key = "KeyFilename";
myCurrUserID = objINI.myValue;
if (PDS_SMS_Pgm_Main.sCurrUserID != "NOT AVAILABLE")
{ objINI.myValue = myNewUserID; }
else
{ return false; }
}
else { return false; }
PDS_SMS_Pgm_Main.sNewUserID = myNewUserID;
PDS_SMS_Pgm_Main.sCurrUserID = myCurrUserID;
return true;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return false;
}
}
Procedure 3:
public static bool InitLNotesSessionPDS()
{
try
{
// define a session in order to capture the System.Type
NotesSession gobjSession0 = new NotesSession();
Type lnType = gobjSession0.GetType();
// create now the instance to be used
gobjSession = (Domino.NotesSession)Activator.CreateInstance(lnType);
gobjSession.Initialize(PDS_SMS_Pgm_Main.myPDSPassWord);
gobjDB = gobjSession.GetDatabase(PDS_SMS_Pgm_Main.myPDSServer
if (gobjDB.IsOpen) { }
else { gobjDB.Open(); }
return true;
}
catch (Exception ex)
{ Console.WriteLine(ex.Message); return false; }
}
Brief Description:
1. SetLoginUser is the procedure that captures the current LN user
2. gobjSession is a Domino.NotesSession-type variable/object.
3. gobjDB is a Domino.NotesDatabase-type variable/object.
4. NOTE: the difference between VB.NET and C#.NET is that an additional Domino.NotesSession object (gobjSession0) is first created
No comments:
Post a Comment