Greetings,
this issue has more to do with the fact that I am transitioning to C#.net from VB.net. I have successfully logged into LaserFiche using the following function call and function;
Call:
// ====== Login to Laserfiche ====== 8/13/2014
bool loginStatus = LFLoginRA(Properties.Settings.Default.LFServerName, Properties.Settings.Default.LFRepositoryName, Properties.Settings.Default.LFUserID, Properties.Settings.Default.LFPassword);
Function:
public bool LFLoginRA(string LFServerName, string LFRepositoryName, string LFUserID, string LFPassword)
{
// Using the overloaded RepositoryRegistration constructor
RepositoryRegistration myRepoReg = new RepositoryRegistration(LFServerName, LFRepositoryName);
Session mySess = new Session();
mySess.LogIn(LFUserID, LFPassword, myRepoReg);
return true;
The problem is when I go to create a folder, the error says that the mySess Does not exist in the current context. I am calling this from within a for each loop.
Here is the call;
Dynamicfolder(lfFolderPath,mySess); mySess is where the error is encountered. this is the only error I am getting.
Here is the sub;
public static void Dynamicfolder(string FolderPath,Session mySess)
{
try
{
// Checks to see if a folder with the desired name
// already exists.
FolderInfo FI = Folder.GetFolderInfo(FolderPath, mySess);
}
catch (LaserficheRepositoryException ex)
{
// Creates the folder if the error code indicates
// that it doesn't exist.
if (ex.ErrorCode == 9001) //"Entry not found"
{
Folder.Create(Folder.GetFolderInfo(FolderPath, mySess), "Subfolder", EntryNameOption.None, mySess);
}
}
If this were VB I would think it has to do with session mySess not being a global variable.
Any help you can provide would be great.
Phil