4 Replies - 708 Views - Last Post: 26 February 2011 - 07:41 AM Rate Topic: -----

#1 Justin3085  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 20-December 09

Certain lines from text file invisible

Posted 22 February 2011 - 02:38 PM

I have a small app I created which randomly draws a SSN from a text file using Streamreader. Its a basic GUI with a button that draws the random number.

I'm curious if there is a way to add additional text to the lines in the text file but are invisible to the application?

For example in the actual .txt file a line will be:

123-45-6789 (can I add text here but invisible to what the app displays?)
321-54-9876 (Additional Text here)
etc.

Reason is for ease of reading and validating the number to a name.

I guess I could cheat and resize the textbox to only include the number and cut out the name but I'd rather code it if possible.

Is This A Good Question/Topic? 0
  • +

Replies To: Certain lines from text file invisible

#2 Justin3085  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 20-December 09

Re: Certain lines from text file invisible

Posted 22 February 2011 - 02:43 PM

I'm not certain if this applies but I will try it. Should of searched better so I apologize if this is the fix and I didn't find it until after I posted.

http://www.dreaminco...avoid-comments/
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5432
  • View blog
  • Posts: 11,644
  • Joined: 02-June 10

Re: Certain lines from text file invisible

Posted 22 February 2011 - 02:46 PM

Since you only want to show the random SSN, which is always 11 characters just show the first 11 from the line you read out of the txt file.

string.substring(11)

This post has been edited by tlhIn`toq: 22 February 2011 - 02:47 PM

Was This Post Helpful? 1
  • +
  • -

#4 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4425
  • View blog
  • Posts: 7,693
  • Joined: 08-June 10

Re: Certain lines from text file invisible

Posted 22 February 2011 - 02:49 PM

Can you post the code you're currently using to get the SSN? It'll make it easier for us to help you out.

Edit: actually, that link you found could be quite helpful to you.

Also, you could just use Substring as suggested by tlhIn`toq

This post has been edited by insertAlias: 22 February 2011 - 02:50 PM

Was This Post Helpful? 1
  • +
  • -

#5 Justin3085  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 20-December 09

Re: Certain lines from text file invisible

Posted 26 February 2011 - 07:41 AM

Thank you my friends. As always, you never disappoint :)!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1