# Get the existing visited OS customer in Adobe Air

I require the name of the existing visited customer in my Air/Flex application. The application will just be released on Windows equipments. I assume I can acquire this by regexing the User directory site, yet am open to various other means.

0
2019-05-04 00:25:15
Source Share

Also I would certainly attempt :

File.userDirectory.name


Yet I do not have actually Air mounted so I can not actually examine this ...

0
2019-05-07 18:32:12
Source

Here is a remedy that operates in XP/ Vista, yet is most definitely expanding to OSX, linux, I would certainly still want an additional means.

public static function GetCurrentOSUser():String{
// XP & Vista only.
var userDirectory:String = File.userDirectory.resolvePath("").nativePath;
var startIndex:Number = userDirectory.lastIndexOf("\\") + 1
var stopIndex:Number = userDirectory.length;
var user = userDirectory.substring(startIndex, stopIndex);

return user;
}

0
2019-05-07 17:08:42
Source