Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4014852
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:32:50+00:00 2026-05-20T09:32:50+00:00

my code is- Stream myStream; saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Filter = Ticket files (*.tkt)|*.tkt;

  • 0

my code is-

Stream myStream;
saveFileDialog1 = new SaveFileDialog();

saveFileDialog1.Filter = "Ticket files (*.tkt)|*.tkt";
saveFileDialog1.FilterIndex = 1;
saveFileDialog1.RestoreDirectory = true;
saveFileDialog1.Title = "Save text Files";

if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
   myStream = saveFileDialog1.OpenFile();
   if (myStream != null)
   {
       StreamWriter wText = new StreamWriter(myStream);
       string st = gettxt();
       wText.Write(st);
       //wText.WriteLine("sdfsderfsdsf");
       myStream.Close();
    }
}

whenever i uncomment Writeline and comment write(st) notthing is written..
and the string should be of specific length then only data is saved in the tkt file..
and last problem is that if text is too large then part of the text is only written..
please help me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:32:51+00:00Added an answer on May 20, 2026 at 9:32 am

    There are very few ways to explain the problem, other than there’s a problem with the app that reads the file. Beware that you are writing a .txt file, it might not necessarily be compatible with a .tkt file format. Whatever that looks like. For one, the file will contain a BOM, 3 bytes at the start of the file that says it is a utf-8 formatted text file.

    One thing you could try to diagnose the problem better:

       using (var wText = new StreamWriter(myStream, Encoding.Default)) {
           string st = gettxt();
           wText.Write(st);
           //wText.WriteLine("sdfsderfsdsf");
       }
    

    The Encoding argument specifies that the characters should be written in the default code page and without a BOM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose this C# code: using (MemoryStream stream = new MemoryStream()) { StreamWriter normalWriter =
My application plays audio stream Here the code: MediaPlayer mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
In my Java code, I start a new process, then obtain its input stream
Consider this code: FileOutputStream stream=null; ObjectOutputStream objStr=null; try { stream=new FileOutputStream(defaultFile); objStr=new ObjectOutputStream(stream); objStr.writeObject(obj);
Assume the following code: Stream file = files[0].InputStream; var FileLen = files[0].ContentLength; var b
I use the following code to stream large files from the Internet into a
Stackoverflow: For a cs assigment I am using the following code to stream audio.
I use this code below to hide stream url of songs for my wordpress
I have this code, I open a stream (without closing or disposing it), then
Is there a native JDK code to copy files(buffers, streams, or whatever)?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.