Community
Showing results for 
Search instead for 
Do you mean 
Reply

how do i get current sessions user , password and actpath ?

Avid Listener
Posts: 83
Country: Malaysia

how do i get current sessions user , password and actpath ?

hi all,

 

i developed act link with my accounting software.

i need to know how i can get current sessions of username, password and act path ?

 

Thanks.

Avid Listener
Posts: 83
Country: Malaysia

Re: how do i get current sessions user , password and actpath ?

fr the sdk i cant find how to get all username and password from ACT DB.

I got 1 more questions i had added new options then how i can add permissions for administrators to give certain rights to my users ?

 

Thanks.

Copper Super Contributor
Posts: 59
Country: USA

Re: how do i get current sessions user , password and actpath ?

[ Edited ]

Hi Jeff,

 

You can get the current user using ActFramework.CurrentUser property. You can't get the password because this would present a security vulnerability, anyone could just use the framework to get the password for the current logged on user.

 

To get the act path and I assume you are talking about the path where act application is installed, you should get the following registry key:

HKLM\Software\Act\Install\InstallPath

 

Here's a routine you could reuse:

 

Private Shared Function GetACTPathFromReg() Dim regPath As RegistryKey Try regPath = Registry.LocalMachine.OpenSubKey("SOFTWARE\\ACT\\Install") Return regPath.GetValue("InstallPath", "") Catch ex As Exception Return "" End Try End Function

 

 

 

Regards,

Hugo

Datastream Custom Solutions

www.datastreamcs.com

 

Message Edited by hugovale on 04-13-2009 02:29 PM
Message Edited by hugovale on 04-13-2009 02:30 PM
Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Avid Listener
Posts: 83
Country: Malaysia

Re: how do i get current sessions user , password and actpath ?

Hi Hugovale,

 

Actually what i trying to achieve is when i try to export ACT db to my accounting software. I need to logon to act framework.

So i no need current user to type username again. But for password maybe is compulsory for user to input.

 

For the ACT pad filepath i need to detect the current filepath so as user no need to browse again since user had log on to the PAD file.

 

Thanks.

Nickel Super Contributor
Posts: 441
Country: UK

Re: how do i get current sessions user , password and actpath ?

The last opened pad file is stroed in HKEY_CURRENT_USER\Software\ACT\LastDBFileUsed .

 

Tom

Avid Listener
Posts: 83
Country: Malaysia

Re: how do i get current sessions user , password and actpath ?

Hi Tdavis,

 

thanks will try it out.

Avid Listener
Posts: 83
Country: Malaysia

Re: how do i get current sessions user , password and actpath ?

Hi Hugovale,

 

In c# how to declare the registrykey ?

 

Thanks.

Copper Super Contributor
Posts: 59
Country: USA

Re: how do i get current sessions user , password and actpath ?

[ Edited ]

Here's the code I sent you in C#, converted at http://www.developerfusion.com/tools/convert/vb-to-csharp/

 

Also, be aware that the RegistryKey class is under the Microsoft.Win32 namespace, so you will need the statement "Imports Microsoft.Win32" at the top of your code file.

 

 

private static object GetACTPathFromReg()
{
    RegistryKey regPath = default(RegistryKey);
  
    try {
        regPath = Registry.LocalMachine.OpenSubKey("SOFTWARE\\\\ACT\\\\Install");
      
        return regPath.GetValue("InstallPath", "");
    }
    catch (Exception ex) {
        return "";
    }
}

 

 

 

Message Edited by hugovale on 04-14-2009 06:41 PM
Message Edited by hugovale on 04-14-2009 06:43 PM
Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Avid Listener
Posts: 83
Country: Malaysia

Re: how do i get current sessions user , password and actpath ?

Hi Hugo,

 

Thanks so much for your prompt reply.