简体   繁体   English

如何创建az和0-9(最多8个字符)的字典并将其另存为.txt文件?

[英]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.

相关问题 有没有办法找出C#中的字符串是否不包含数字和字符0-9和AZ? - Is there a way I can find out if a string in C# does not contain the numbers & characters 0-9 and A-Z? 如何获取正则表达式来检查字符串是否只包含字母字符[az]或[AZ]? - How can I get a regex to check that a string only contains alpha characters [a-z] or [A-Z]? 如何匹配两个括号之间的这种模式(字符 az,数字)? - How can I match this pattern (characters a-z, numbers ) between two brackets? 正则表达式:0-9 AZ az或其中任何一个&#39;!#$%&&#39;* + - / =?^ _`{|}〜 - Regular Expression: 0-9 A-Z a-z or any of these '!#$%&'*+-/=?^_`{|}~ 我有正则表达式将字符串拆分为单词,数字和标点符号列表。 如何制作列表中的“az”和“0-9”单个元素? - I have regex to split string to words, numbers and punctuation marks list. How to make “a-z” and “0-9” single elements of list? 对AZ,0-9和-使用正则表达式和-? - Using regex for A-Z, 0-9, - and dot? 正则表达式:仅限AZ字符 - Regex: A-Z characters only 在 C# 中将字符串从数字 0-9 增加到小写 az 到大写 AZ - Increment a string from numbers 0-9 to lowercase a-z to uppercase A-Z in C# 如何在C#中没有特殊字符或数字的情况下用字母(az)询问用户输入 - How to ask for user input with letters (a-z) only without special characters or numbers in C# 如何将我创建的文件保存到路径中 - How can i save a file that i create into a path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM