Hi, I am quite new to worksite and developing a program in .net. I have a question about login in to worksite. Since worksite stores the information about the registered servers, username and password in the registry, is there a way we can utilise that instead of using our own mechanism of storing the user logins? Is there any object in the COM library we can use to retrieve that information? Thank's
Hi jny,What I want to achieve is to make my application to automatically login like Desksite or Worksite Addin for Office. For example, if user had registered a server and put their password in, the next time they go into Desksite they don't need to put in their login details anymore since Desksite gets the login details from the registry. Same thing applies to worksite extension for Office products.Now if I want to build an application, can I use the login details that worksite kept in the registry because if not, I have to maintain my own registry/configuration for storing the user login details (username, password, trusted login, server name, etc) in order to make my application to automatically login the next time after they have put their login details the first time.The thing is if I can use the login details that worksite kept, why do I have to maintain my own.I can Display the RegisterServerCmd but user still have to click on Connect, it will return all the user login details. But I still can't make it automatically connect the first time.Cheers,
using IMANEXTLib;using IManage;private void exLoginCmd(){IManDMS iDMS = new ManDMSClass();//Servers to connectstring[] arrServerToConnect = new string[2];arrServerToConnect[0] = "DSS_WIN2003SERV"; //Example of a DMS server namearrServerToConnect[1] = "WS-RED"; //Example of a DMS server nameContextItems context = new ContextItemsClass();LoginCmd oCmd = new LoginCmdClass();for (int i = 0; i < arrServerToConnect.Length; i++){string[] arrServer = new string[1];arrServer[0] = arrServerToConnect;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();bool bRefresh = false;bRefresh = (bool)context.Item("iManExt.Refresh");if (bRefresh){string svrReturned = context.Item("ReturnedServer").ToString();string usrReturned = context.Item("ReturnedUserID").ToString();string pwdReturned = context.Item("ReturnedPassword").ToString();object AutoReturned = context.Item("ReturnedAutoLogin"); //0=N; -1=Y;object TrustedReturned = context.Item("ReturnedTrustedLogin"); //0=N;-1=Y;MessageBox.Show("Connected to server: " + svrReturned);}}catch (Exception ex){MessageBox.Show(ex.Message);}context.Remove("iManExt.Refresh");context.Remove("iManExt.SilentLogin");context.Remove("NRTSessions");context.Remove("SelectedNRTSessionNames");context.Remove("ReturnedServer");context.Remove("ReturnedUserID");context.Remove("ReturnedPassword");context.Remove("ReturnedTrustedLogin");context.Remove("ReturnedAutoLogin");this.Close();}}