I could not read the site you specified b'coz the access
is denied for that site in our college.
When i say output i mean the text in the file ie., the
whole output of the file.
The file is being created when the condition satisfies for
the first time , and from the second time onwards the text
in the richtextbox of form should get appended to the file
created.
But i thing the problem is somewhere in the creation of
the file because if the condition is satisfying only for
one time then the output of my file is correct ie., i am
getting the output what i am expecting. But if the
condition is satisfying for more than one time then i am
not getting the correct output.
rtb2.Text is the text in the richtextbox which i want to
have in the file GlobalDeclarations.cs
filetext1.Text="d:\santhu\projects\current\PB8.0";
tgname="cd_core";
if(index=="2" || index=="5")
{
files=new FileStream
(filetext1.Text+"\\"+tgname+"\\"+"GlobalDeclaratio ns"+".cs"
,FileMode.Append,FileAccess.Write,FileShare.ReadWr ite);
swriter=new StreamWriter(files);
if(san==0)
{
swriter.WriteLine("using System;");
swriter.WriteLine("using System.IO;");
swriter.WriteLine("namespace "+ " "+tgname+"\r\n"+"{");
swriter.WriteLine("public class
GlobalDeclarations "+"\r\n"+"{");
}
swriter.WriteLine(rtb2.Text);
swriter.Close();
}
No, that's *part* of your code. Please post *complete*
code. Did youread the page I posted a link to?
But the output i am getting is somthing like this
000000000 75 73 69 6E 67 20 53 79 73 74 65 6D 3B 0D 0A
75using
000000010 74 69 24 24 44 44 3D 43 48 4F 0D 3B 0D 2E 6D
System
.................................................. ......
.... .................................................. .etc
in this way
What could be the problem
When you say "the output you are getting is", do you mean
that's thewhole output of the file? Was there a file there before?
What were youexpecting to get differently?
Please post enough information so that I (or someone
else) can fullyreproduce this, with exactly what you expected to happen
and whathappened differently. Currently you're leaving us
guessing.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.