Post: Read a gpd file? (VB.NET)
01-26-2012, 01:29 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Can someone please tell me how to read a text file or gpd file into a text box. I am.using vb 2010 express.
01-26-2012, 03:27 AM #2
Epic?
Awe-Inspiring
Originally posted by nightsniper215 View Post
Can someone please tell me how to read a text file or gpd file into a text box. I am.using vb 2010 express.


As far as reading a text file into a text box, the easiest method is to use You must login or register to view this content. like so:
    textBoxName.Text = System.IO.File.ReadAllText(path)

Note that you should substitute path with the path to your text file and textBoxName with the name of your text box.

There are alternatives to this, even within the File class.

As far as reading GPD files goes, it'll depend on the type of GPD file. Assuming you mean the Xbox 360 data files, you might want to start your research at You must login or register to view this content..
01-26-2012, 12:53 PM #3
Yes, i want to read a call of duty 4 gpd, and i want to use an open file dialog so would the path be the open file dialog filename?
01-26-2012, 07:13 PM #4
Epic?
Awe-Inspiring
Originally posted by nightsniper215 View Post
Yes, i want to read a call of duty 4 gpd, and i want to use an open file dialog so would the path be the open file dialog filename?


If you're having trouble, you might want to read You must login or register to view this content. (and the two that follow it), as well as refer to You must login or register to view this content..

To answer your question: yes.

Here's a little snippet:
    
Dim ofd As New OpenFileDialog() ' declares a new openfiledialog
Dim path As String ' will be used to store the path to the file
ofd.FileName = String.Empty ' makes the filename empty to begin with
ofd.InitialDirectory = "C:\" ' wherever you want your OFD to open to
ofd.Filter = "All files(*.*)|*.*" ' used to require the file to be a certain type, specify new types in the format of Name|*.ext, separate entries with a |

If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then ' ensures the user clicked "OK"
path = ofd.FileName ' path will contain the path to the file, as well as the name of the file, as the FileName property provides these details
End If

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo