function for .net-RAND-extraction