Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#匹配网站文本文件中的数字_C#_Matching - Fatal编程技术网

C#匹配网站文本文件中的数字

C#匹配网站文本文件中的数字,c#,matching,C#,Matching,您好,我在本地文件到远程文件或网站文件的匹配号码方面遇到问题。这是我要匹配的文件 LocalFile.Txt//包含 101 匹配到网站文件 patch.Txt 1文件1.rar 2文件2.rar . . . 101文件101.rar 102文件102.rar 103文件103.rar 我想做的是将我的LocalFile.txt中的数字与我的网站上的patch.txt中的数字进行匹配,然后下载匹配数字下面的数字 我有从远程读取文本文件的简单代码 WebClient web

您好,我在本地文件到远程文件或网站文件的匹配号码方面遇到问题。这是我要匹配的文件

LocalFile.Txt//包含 101 匹配到网站文件 patch.Txt

1文件1.rar 2文件2.rar . . . 101文件101.rar 102文件102.rar 103文件103.rar

我想做的是将我的LocalFile.txt中的数字与我的网站上的patch.txt中的数字进行匹配,然后下载匹配数字下面的数字

我有从远程读取文本文件的简单代码

            WebClient web = new WebClient();
        System.IO.Stream stream = web.OpenRead("http: // mysite .com /update_regular/patchlist.txt");
        using (System.IO.StreamReader reader = new System.IO.StreamReader(stream))
        {
            String text = reader.ReadToEnd();
            MessageBox.Show(text); // Just to show the result for now
        }
从我的网站下载文件

         WebClient webClient = new WebClient();
        webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
        webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
        webClient.DownloadFileAsync(new Uri("http: // mysite . com/update_regular/754500106.rar"), @"H:\test\754500106.rar");
    }
    private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
    {
        progressBar1.Value = e.ProgressPercentage;
    }

    private void Completed(object sender, AsyncCompletedEventArgs e)
    {
        MessageBox.Show("Download completed!");
    }

我如何才能完成任务,以实现完全可操作的匹配和下载。。提前感谢您的帮助。

我们没有完成您的作业,我们可以帮助您解决具体问题。要提取数字,请查看Regex类。要查找匹配的数字,请查看字典或哈希集以读取RAR文件。请检查-希望这将帮助您完成任务。是的,我只需要一个方法。我只是解释了一点详细的解释嘿嘿谢谢Casperah