Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 12th, 2011, 11:12 PM
Registered User
 
Join Date: May 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Textbox info to txt file name

I am working on a project and Im trying to figure out somthing.
I am trying to create a text file using the info that the user inputs
Ex. the user enters thier name in a text box hits the save button and it creates a file called name.txt I have it saving but cant make it save as a .txt file everytime I open the file I have to choose a program to open it with.

Here is an Example of the code:


strFilename = "C:\Users\Desktop\" & Last_NameTextBox.Text

It saves the file as the info I enter but no extention so it dont know what to open the file with

any suggestions
Thank you
Jeremy
Reply With Quote
  #2 (permalink)  
Old May 13th, 2011, 06:06 AM
Authorized User
Points: 448, Level: 7
Points: 448, Level: 7 Points: 448, Level: 7 Points: 448, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2011
Posts: 86
Thanks: 1
Thanked 12 Times in 12 Posts
Default

HI,

looks like you forgot to append the txt file extension to your filename variable.

Please try it like this:
Code:
 
strFilename = @"C:\Users\Desktop\" & Last_NameTextBox.Text & ".txt"
Hope this helps.
Reply With Quote
  #3 (permalink)  
Old May 14th, 2011, 09:54 PM
Registered User
 
Join Date: May 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you that is exactly What I was missing
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple txt file input to excel in 1 row per file vickyso88 Excel VBA 3 August 24th, 2009 03:11 PM
read any ".txt" file RodrigoGuteriez C# 3 November 18th, 2008 01:07 PM
Reading txt file umeshtheone SQL Server 2000 9 May 15th, 2007 01:43 AM
How Can I Add Info From a Txt File Into a DB? Lucy Classic ASP Professional 3 October 21st, 2003 12:00 PM



All times are GMT -4. The time now is 02:27 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.