2 Replies - 2773 Views - Last Post: 28 February 2011 - 07:30 PM Rate Topic: -----

#1 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

How can I save the this XML to a C# string variable?

Posted 28 February 2011 - 07:00 PM

http://www.dreaminco...showuser=335389

I'd like to save that XML response to a string variable in my class. Is this possible?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpDream.Api.Users.Sources
{
    internal class TestSource : IUserInformationSource
    {
        public string GetInformationSource(int forumUserId)
        {
            return @"save things";
        }
    }
}


I seem to remember being able to save string literals, but I do not remember how.

To clarify: I do not want to download the string, I want to copy paste the response to a variable. This concrete implementation is for testing purposes when the internet isn't working or whatnot.

This post has been edited by Sergio Tapia: 28 February 2011 - 07:04 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How can I save the this XML to a C# string variable?

#2 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4525
  • View blog
  • Posts: 7,893
  • Joined: 08-June 10

Re: How can I save the this XML to a C# string variable?

Posted 28 February 2011 - 07:22 PM

Simplify your life. Dump it into a text file and load it from there.
Was This Post Helpful? 0
  • +
  • -

#3 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: How can I save the this XML to a C# string variable?

Posted 28 February 2011 - 07:30 PM

Turns out you have to replace " to "" inside of string literals.

Example:

<car type=""honda"">

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1