Click here to Skip to main content
15,923,087 members
Home / Discussions / C#
   

C#

 
GeneralRe: Storing a high score list Pin
PIEBALDconsult25-Mar-10 16:13
mvePIEBALDconsult25-Mar-10 16:13 
GeneralRe: Storing a high score list Pin
Luc Pattyn25-Mar-10 16:23
sitebuilderLuc Pattyn25-Mar-10 16:23 
GeneralRe: Storing a high score list Pin
The Cake of Deceit26-Mar-10 4:21
The Cake of Deceit26-Mar-10 4:21 
GeneralRe: Storing a high score list Pin
Not Active25-Mar-10 14:40
mentorNot Active25-Mar-10 14:40 
GeneralRe: Storing a high score list Pin
DaveyM6925-Mar-10 15:04
professionalDaveyM6925-Mar-10 15:04 
GeneralRe: Storing a high score list Pin
fuad_200025-Mar-10 22:15
fuad_200025-Mar-10 22:15 
GeneralRe: Storing a high score list Pin
Calla25-Mar-10 22:50
Calla25-Mar-10 22:50 
QuestionHow to read dump *.dmp with C# Pin
harji1725-Mar-10 13:42
harji1725-Mar-10 13:42 
AnswerRepost Pin
Not Active25-Mar-10 14:34
mentorNot Active25-Mar-10 14:34 
AnswerRe: How to read dump *.dmp with C# Pin
fuad_200025-Mar-10 23:08
fuad_200025-Mar-10 23:08 
Question[C# Service]Check if file exist on network share with LocalSystem Pin
aleroot25-Mar-10 12:22
aleroot25-Mar-10 12:22 
AnswerRe: [C# Service]Check if file exist on network share with LocalSystem Pin
Dave Kreskowiak25-Mar-10 13:43
mveDave Kreskowiak25-Mar-10 13:43 
GeneralRe: [C# Service]Check if file exist on network share with LocalSystem Pin
Bernhard Hiller30-Mar-10 4:22
Bernhard Hiller30-Mar-10 4:22 
GeneralRe: [C# Service]Check if file exist on network share with LocalSystem Pin
Dave Kreskowiak30-Mar-10 11:25
mveDave Kreskowiak30-Mar-10 11:25 
Questionhow to run database page by IIS Pin
hotthoughtguy25-Mar-10 8:11
hotthoughtguy25-Mar-10 8:11 
AnswerRe: how to run database page by IIS Pin
kevinnicol25-Mar-10 9:00
kevinnicol25-Mar-10 9:00 
GeneralRe: how to run database page by IIS Pin
hotthoughtguy25-Mar-10 9:09
hotthoughtguy25-Mar-10 9:09 
GeneralRe: how to run database page by IIS Pin
kevinnicol25-Mar-10 9:14
kevinnicol25-Mar-10 9:14 
GeneralRe: how to run database page by IIS Pin
hotthoughtguy25-Mar-10 9:17
hotthoughtguy25-Mar-10 9:17 
GeneralRe: how to run database page by IIS Pin
hotthoughtguy25-Mar-10 9:18
hotthoughtguy25-Mar-10 9:18 
GeneralRe: how to run database page by IIS Pin
hotthoughtguy25-Mar-10 9:33
hotthoughtguy25-Mar-10 9:33 
AnswerRe: how to run database page by IIS Pin
Not Active25-Mar-10 11:51
mentorNot Active25-Mar-10 11:51 
AnswerRe: how to run database page by IIS Pin
Mycroft Holmes25-Mar-10 14:55
professionalMycroft Holmes25-Mar-10 14:55 
GeneralRe: how to run database page by IIS Pin
hotthoughtguy26-Mar-10 3:24
hotthoughtguy26-Mar-10 3:24 
QuestionEncoding issues?? [modified] Pin
Jacob Dixon25-Mar-10 6:52
Jacob Dixon25-Mar-10 6:52 
Ok what I am doing is calling a web service (C#) with javascript. I use the .innerHTML to get all the html within a certain div (this works fine). I then pass that data over to the webservice (which accepts a string array)..

First I make a javascript array (first contains the path to write the file, second position contains the .innherHTML).

When that gets passed for some reason it doesn't like all the HTML coding. It gives an error. If I just use PLAIN text (I.E. no < > / \) it works perfect.

Web service:
[WebMethod(Description = "Creates a file. First string in the array is the path and second string is the data.")]
public string Update(string[] html)
{
    if (html.Length > 0)
    {
        try
        {
            string path = String.Format(@"{0}", html[0]);
            using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write))
            {
                using (StreamWriter sw = new StreamWriter(fs))
                {
                    sw.WriteLine(html[1], Encoding.ASCII);
                    sw.Close();
                }
                fs.Close();
                return "Updated situation report.";
            }
        }
        catch (Exception ex)
        {
            return "Error: " + ex.Message;
        }
    }
    else
        return "Incorrect parameter lengths.";
}


I'm guessing the streamwriter cannot write those types of charactesr to tmy file? How would I fix this?

In casey ou are wondering this is what should be in the string:

THIS IS MY DOCUMENT<br>
<span style="color: red"> IT CONTAINS COLORS </span><br>
AND OTHER CRAP
modified on Thursday, March 25, 2010 12:59 PM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.