[英]How can I create a dictionary with a-z and 0-9 up to 8 characters long and save it as a .txt file?
Me and a friend have been messing around with this, and with a good bit of research I have not been able to figure this out, granted I know nothing about c#. 我和一个朋友一直在搞弄这个问题,并且经过大量的研究,我仍然无法弄清楚这一点,因为我对c#一无所知。 What we have so far is this
到目前为止,这是
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
for (int length = 8; length > 0; length--)
{
var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
var q = alphabet.Select(x => x.ToString());
int size = length;
for (int i = 0; i < size - 1; i++)
q = q.SelectMany(x => alphabet, (x, y) => x + y);
foreach (var item in q)
Console.WriteLine(item);
}
}
}
} //namespace end
It creates everything we want it to ( I believe), but our only problem is we're not to sure how to save it. 它创建了我们想要的所有东西(我相信),但是我们唯一的问题是我们不确定如何保存它。 Might be due to lack of sleep, but we can't figure it out.
可能是由于睡眠不足,但我们无法解决。
Thanks! 谢谢!
See this link, it explains how to write to a text file 看到此链接,它说明了如何写入文本文件
http://msdn.microsoft.com/en-us/library/aa287548(v=vs.71).aspx http://msdn.microsoft.com/zh-CN/library/aa287548(v=vs.71).aspx
如果您只是用它来创建彩虹表,则可能只想下载一个合适的表: http : //project-rainbowcrack.com/table.htm
using System.IO;
example:
例:
int number;
StreamWriter sw = new StreamWriter("C:/[yourpath]");
for(i = 0; i < number; i++)
{
sw.WriteLine(i);
}
this is an example .. make it yours! 这是一个例子..把它变成你的! i'd sure like to know updates!
我想知道更新! mabey you will make a more sophisticated or better one!
也许您会做的更好或更高级!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.