Stream Reader在文本框中加载文件并设置图像(Path not not legal form) [英] Stream Reader loads file in textbox and sets image (Path not of legal form)
问题描述
我的程序创建了一个文件,其中有一个写入的路径,然后当程序再次启动时,路径应该是文本框的文本(TextBoxX4),那么图像的图片(BackImage)应该是该文件的路径。文本框。唯一的问题是它没有加载图片,而是提出一个错误,说路径不是合法的形式(我检查路径是什么,它看起来很好(它有\和开头的C等))。
这是发生错误的地方:这是一个导致代码图像的链接(在当前选项卡中打开) [ ^ ]
My program creates a file which has a path writen to it then when the program starts up again the path should be the text of the textbox (TextBoxX4), then the picture of an image(BackImage) should be the path of the textbox. Only problem is the fact that it isn't loading the picture and instead comes up with an error saying that the path is not of legal form (i check what the path is and it looks fine (it has the "\" and the "C" in the beginning etc.)).
This is where the error is happening: This is a link leading to an image of the code (opens in current tab)[^]
推荐答案
已修复!
Fixed!
Dim rdr4 As New IO.StreamReader(Application.StartupPath & "\LumiaBrowser3_Settings5.lbrst")
Dim t As String = rdr4.ReadLine
rdr4.Close()
If t = "GlassYHnVGTghXY7VFG5g6Y78j" Then
BStyleG.Checked = True
BStyleI.Checked = False
TextBoxX4.Enabled = False
ButtonX8.Enabled = False
IsBackImage = False
Else
TextBoxX4.Enabled = True
ButtonX8.Enabled = True
BStyleI.Checked = True
BStyleG.Checked = False
TextBoxX4.Text = t
BackImage = Image.FromFile(TextBoxX4.Text)
ThemePictureBox.Image = BackImage
IsBackImage = True
End If
rdrTST.Close()
这篇关于Stream Reader在文本框中加载文件并设置图像(Path not not legal form)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!