Damn, I posted the wrong Fortran code... It´s too early in the morning and I haven´t had any coffee yet ;-)
globaleVariablen is a module where username is declared as character*4. In the C# part you have to name the length of the character, so you write get_username(stringBuilderValue, 4), although the Fortran function doesn´t have a second parameter.
subroutine put_username(value)
use globaleVariablen
implicit none
character*4 username
username = value
end subroutine put_username
!
character*4 function get_username()
use globaleVariablen
implicit none
getusername = username
end function get_username
Markus