Click here to Skip to main content
14,489,030 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,


When i attend an interview they asked me to do this program. how can i do this program. Please help me to do this.


Write a program in C# to store the information of a user such as user_id, user_name, etc..to a File using IOStream. And to search information by giving user_id. All the details should be displayed after searching.(hint : windows or console application)
Posted
Comments
   
Why not simply reading the help?
—SA
Rate this:
Please Sign up or sign in to vote.

Solution 1

The interviewers probably wanted to understand if you were aware about the various file modes e.g. open, append etc.

There are a number of good resources that discuss file I/O on the internet.
http://msdn.microsoft.com/en-us/library/aa287548%28v=vs.71%29.aspx[^]
http://msdn.microsoft.com/en-us/library/8bh11f1k.aspx[^]
http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

After the interview? It's too late to answer the interview question. Better learn the whole System.IO. And, pretty much all of BCL and some other parts of FCL. Well, I cannot guarantee they will ask it all at your next interviews, but I'm pretty much sure, the next questions will be very different. :-)

And the interview preparations is the useless activity. Please read this: SSRS interview questions and answers[^].

—SA
   
Comments
afsal.mp 17-Dec-12 1:43am
   
Hi,
it is not for the interview purpose. i need just aware of that.
thanks
   
To be aware, as I say, learn whole System.IO — it's not so big.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100