Stream as return function

This is a discussion on Stream as return function within the C# Programming forums, part of the General Programming Boards category; Hi, Could anyone please let me know if there are any functions that reads a .txt file and returns a ...

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    141

    Stream as return function

    Hi,

    Could anyone please let me know if there are any functions that reads a .txt file and returns a stream?

    Ak

  2. #2
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,109
    FileStream

    Use msdn for this sort of thing next time.

    http://msdn.microsoft.com/library/de...ClassTopic.asp

    You can pass this FileStream to either StreamWriter or StreamReader.. then you dont have to deal with an array of bytes to read and write.

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    141
    But I need a Stream as return type. The external fn I'm using is not working when I pass the FileStream object
    I need to pass a Stream object. Can I do that?

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    141
    More specifically, I need to put the text into a stream without creating a file.
    Can I do that in C#?

  5. #5
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    MemoryStream

    Once again, use MSDN.

    http://msdn2.microsoft.com/en-us/lib...orystream.aspx
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  2. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM
  3. Replies: 4
    Last Post: 11-23-2003, 07:15 AM
  4. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 07:48 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21