c# open file dialog
Hi,
I am trying to open the FileOpenDlg using the following code and failing:
IManDMS mainDMS = new ManDMS();
IManSession sess = mainDMS.Sessions.Add("FILESITE_SERVER");
sess.Login("username", "password");
IManDatabase currentDatabase = sess.Databases.ItemByName("dbname");
int something = this.Handle.ToInt32();
IMANEXT2Lib.IManFileOpenDlg c = new IMANEXT2Lib.IManFileOpenDlg();
c.Sessions = sess;
c.Show(something);
This is causing the following image to be displayed (attached) with the message:
"An unexpected WorkSite error occurred".
As I am not sure the above code is correct, would anyone care to guide me on this?
Many thanks.
Comments
-
I uually use LogonEx, that way you can used the cached logon details:
public bool LoginEx()
{
var isOk = false;
var iDms = new ManDMS();
ContextItems context = new ContextItemsClass();
LoginCmd oCmd = new LoginCmdClass();
var servers = GetServers();
foreach (var server in servers)
{
var arrServer = new string[1];
arrServer[0] = server;
context.Add("NRTSessions", iDms.Sessions);
context.Add("SelectedNRTSessionNames", arrServer);
context.Add("iManExt.SilentLogin", true);
oCmd.Initialize(context);
oCmd.Update();
try
{
if (oCmd.Status == (int)CommandStatus.nrActiveCommand)
oCmd.Execute();
var bRefresh = false;
bRefresh = (bool)context.Item("iManExt.Refresh");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
foreach (IManSession iSession in iDms.Sessions)
{
isOk = iSession.Connected;
}
}
return isOk;
}
}public string[] GetServers()
{var ret = new string[0];
var servers = Registry.CurrentUser.OpenSubKey(
@Software\Interwoven\WorkSite\8.0\Common\Login\RegisteredServers);
if (servers != null)
{
ret = servers.GetSubKeyNames();
}return ret;
}0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 144 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- Docker Automation
- LiveSite Content Services (LSCS) REST API
- Single Page Application (SPA) Modules
- TeamSite Add-ons
If you are interested in gaining full access to the content, you can register for a My Support account here.