需要帮助这个代码 [英] Need help wit this code

查看:52
本文介绍了需要帮助这个代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

        private void label5_Click(object sender, EventArgs e)
        {

            WebRequest wr = WebRequest.Create(new Uri("https://pastebin.com/raw/93gWJDXC"));
            WebResponse ws = wr.GetResponse();
            StreamReader sr = new StreamReader(ws.GetResponseStream());

            string currentversion = Application.StartupPath + "\\System\\Version.txt";
            string newversion = sr.ReadToEnd();

            if (System.IO.File.Exists(Application.StartupPath + "\\System\\Version.txt"))
            {
                if (currentversion.Contains(newversion))
                {
                    MessageBox.Show("You have the latest version.", "Information");
                }
                else
                {
                    downloadupdate();
                }
            }
        }


它不会检查System / Version.txt中的Version.txt

It wont check the Version.txt in System/Version.txt

推荐答案


        private void label5_Click(object sender, EventArgs e)
        {

            WebRequest wr = WebRequest.Create(new Uri("https://pastebin.com/raw/93gWJDXC"));
            WebResponse ws = wr.GetResponse();
            StreamReader sr = new StreamReader(ws.GetResponseStream());

            string currentversion = Application.StartupPath + "\\System\\Version.txt";
            string newversion = sr.ReadToEnd();

            if (System.IO.File.Exists(Application.StartupPath + "\\System\\Version.txt"))
            {
                if (currentversion.Contains(newversion))
                {
                    MessageBox.Show("You have the latest version.", "Information");
                }
                else
                {
                    downloadupdate();
                }
            }
        }


它不会检查System / Version.txt中的Version.txt

It wont check the Version.txt in System/Version.txt

这是一个VB Net论坛,但是对于概念,看一下这个帖子:

This is a VB Net forum, but as for the concepts, have a look at this thread:

https:// social .msdn.microsoft.com /论坛/ vstudio / EN-US / b1b80110-5810-46ca-a3f0-219d6d23fa2d /读取的文本文件中,droupbox - 使用 - vbnet-2013?论坛= vbgeneral

https://social.msdn.microsoft.com/Forums/vstudio/en-US/b1b80110-5810-46ca-a3f0-219d6d23fa2d/read-text-file-in-droupbox-using-vbnet-2013?forum=vbgeneral

这是一个很长的帖子,但你可以滚动到底部,然后备份几个帖子并从那里阅读。

That's a long thread but you can scroll to the bottom and then back up a few posts and read from there.


这篇关于需要帮助这个代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆