gpt4 book ai didi

.net - vb.net从web .txt文件读取文本并在文本框中显示它?

转载 作者:行者123 更新时间:2023-12-04 23:23:58 25 4
gpt4 key购买 nike

我正在尝试从Internet .txt文件中读取一些数字并将其显示在文本框中,但是没有结果...

这些系统是导入的:

Imports System.IO
Imports System.Text
Imports System.Net


这是读取文件的代码:

Dim address As String = "http://www.url.com/text.txt"
Dim client As WebClient = New WebClient()
Dim reply As String = client.DownloadString(address)
TextBox2.Text = reply

最佳答案

尝试以下方法:

Dim address As String = "http://www.stackoverflow.com"
Dim client As WebClient = New WebClient()
Dim reader As StreamReader = New StreamReader(client.OpenRead(address))
Textbox2.Text = reader.ReadToEnd

关于.net - vb.net从web .txt文件读取文本并在文本框中显示它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16655735/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com