Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Lukasz on July 24, 2014, 06:36:11 pm

Title: [C#] How to get actual Author name
Post by: Lukasz on July 24, 2014, 06:36:11 pm
This is my first post here, so hello everybody!

I want to get and save for example in db or string, the actual username or author name, which can be set in EA in Tools>Options. I found information about GetCurrentLoginUser (boolean
GetGuid = false) method, but it is necessary enabled security. I'm looking for the idea how to get current login/author without enabled security.
Can anybody help me?
Title: Re: [C#] How to get actual Author name
Post by: Geert Bellekens on July 24, 2014, 06:45:38 pm
you can ask the Windows about the currently logged in user.
I remember doing so in the past.

Geert
Title: Re: [C#] How to get actual Author name
Post by: Lukasz on July 24, 2014, 07:01:13 pm
Yes, but the currently logged in Windows user can be different from the this set in Enterprise Architect. What if user will change it?

It is possible to get author from this, marked control?
(http://i62.tinypic.com/n2dahz.jpg)
Title: Re: [C#] How to get actual Author name
Post by: Geert Bellekens on July 24, 2014, 07:46:54 pm
Ah when the user changes the author field in the options then you'll find the author in the registry
HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\OPTIONS\AUTHOR

Geert
Title: Re: [C#] How to get actual Author name
Post by: Lukasz on July 24, 2014, 07:50:57 pm
Wow! Thanks, it solved my problem :) I'll use it.