RE: C# Writing to a file

  • From: "Celia Rodriguez" <celia-rodriguez@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 7 May 2010 23:29:11 -0500

Thanks the " fixed the \ problem.
now I have one other problem.
Error   1       No overload for method 'AppendAllText' takes '1' arguments


Sorry for all the questions.  I have never used this method and I am kind of
lost.


Thank you for all of your help.

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Dave
Sent: Friday, May 07, 2010 10:27 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: C# Writing to a file

You also need quotes around both parameters.  The method signature is:
File.AppendAllText Method (String, String).

For example,
String Data = "some data to append to an existing file";
File.AppendAllText("C:\\Documents and Settings\\celia\\My Documents\\Visual
Studio\\Projects\\TestCode", Data);


On 5/7/10, Tyler Littlefield <tyler@xxxxxxxxxxxxx> wrote:
> Hello,
> you need to escape your \ by doing \\. So, it'll look like:
> C:\\myfolder1\\myfolder2...
>
> ----- Original Message -----
> From: "Celia Rodriguez" <celia-rodriguez@xxxxxxxxxxxxx>
> To: <programmingblind@xxxxxxxxxxxxx>
> Sent: Friday, May 07, 2010 8:15 PM
> Subject: C# Writing to a file
>
>
>> Hi Varun,
>>
>> I tried writing to a file, but the comiler does not like the ?
>> \.  The following is what I coded.
>> File.AppendAllText(C:\Documents and Settings\celia\My Documents\Visual
>> Studio\Projects\TestCode,Data);
>>
>> It gives me an error on the \.  Do you know what I need to do so it will
>> except the \?
>>
>> Thanks,
>> Celia
>>
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: