Large data mining, where call logging is a very important real-time data. In order to do experiments, often need to generate random phone number.
In order to generate the related records of random mobile phone number quickly in a single computer environment, using C #, the main follow-up can directly use its multi-core parallel strategy.
The code to do this is as follows:
Private string[] Telstarts = " 134,135,136,137,138,139,150,151,152,157,158,159,130,131,132,155,156,133,153,180,181,182,183,185,186,176,187,188,189,177,1 78 ". Split (', ');
<summary>
Generate phone numbers randomly
</summary>
<returns></returns>
public string Getrandomtel ()
{
int n = ran. Next (10, 1000);
int index = ran. Next (0, telstarts.length-1);
String a = Telstarts[index];
string second = (ran. Next (100, 888) + 10000). ToString (). Substring (1);
String thrid = (ran. Next (1, 9100) + 10000). ToString (). Substring (1);
Return to the second + thrid;
}
This is done to test, generate 100 data to test, the result is as follows: