Book a Demo

Author Topic: [C#] How to get actual Author name  (Read 5559 times)

Lukasz

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
[C#] How to get actual Author name
« 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?
« Last Edit: July 24, 2014, 06:36:31 pm by stuk06 »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [C#] How to get actual Author name
« Reply #1 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

Lukasz

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [C#] How to get actual Author name
« Reply #2 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?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [C#] How to get actual Author name
« Reply #3 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

Lukasz

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [C#] How to get actual Author name
« Reply #4 on: July 24, 2014, 07:50:57 pm »
Wow! Thanks, it solved my problem :) I'll use it.