C#生成QQ号码,一行一个,我将其写成了一个方法,
代码如下:
/// <summary>
/// 生成QQ号码
/// </summary>
/// <param name="initQQ">起始QQ号码</param>
/// <param name="endQQ">终止QQ号码</param>
public void ProduceQQ(UInt64 initQQ,UInt64 endQQ)
{
try
{
string path = Application.StartupPath + "\\newQQ.txt";
FileStream file = new FileStream(path, FileMode.Create);
StreamWriter sw = new StreamWriter(file);
UInt64 count = endQQ - initQQ;
count++;
for (UInt64 i = 0; i < count; i++)
{
sw.WriteLine(initQQ.ToString());
initQQ++;
}
string rst = string.Format("生成成功,共有{0}个QQ号码!文件存在本程序目录下面,名为newQQ.txt",count);
MessageBox.Show(rst);
sw.Close();
file.Close();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString() + ex.Message);
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
您的十分满意是我追求的宗旨。
您的一点建议是我后续的动力。