vb.net - I get An unhandled exception of type 'System.InvalidCastException' -
i keep getting invalidcastexception each time use code. can help? working on program called crystal. crystal library of games.
label1.text = "please wait..." 'this game's info can use reasons. label1.text = "getting game info..." dim filereader string filereader = my.computer.filesystem.readalltext(gamepath \ "crystal\gamename.txt") '<-------- error here 'this check contents, make sure correct. label1.text = "now checking contents..." if my.computer.filesystem.directoryexists(gamepath \ "crystal") label1.text = "yup. crystal game." else msgbox("this not crystal game. make sure crystal folder in package. ") me.close() end if 'crystal folder files 'this check gamename.txt label1.text = "checking crystal folder data..." if my.computer.filesystem.fileexists(gamepath \ "crystal\gamename.txt") label1.text = "found gamename.txt" end if 'this check image.png if my.computer.filesystem.fileexists(gamepath \ "crystal\image.png") label1.text = "found image.png" end if 'this check start.bat if my.computer.filesystem.fileexists(gamepath \ "crystal\start.bat") label1.text = "found start.bat" end if ' create folder game going in. ' extract game c:\crystal\library label1.text = "extracting game files..." zipfile.extracttodirectory(gamepath, "c:\crystal\library")