C# XML tag finder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • weicheong
    New Member
    • Mar 2009
    • 2

    C# XML tag finder

    Hi guys, I'm new to the forum ^^
    I'm suppose to create a simple program which will actually decrypt and encrypt XML file using RijndaelManaged 256 bits...so nw i need to know how to find the start and end of a XML tag such tat i can actually find the part of ciphertext and replace with the normal text...Thanks in adv^^
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Homework assignments

    Originally posted by weicheong
    I'm suppose to [...]
    Hint 1: Try hitting Google with terms of your programming language and primary terms of what you want to do. For example "C# custom events" or "VB datagrid Excel". I've found this to be a very effective tool.
    Hint 2: Your text book
    Hint 3: Your instructor
    Hint 4: Posting guidelines regarding homework assignments.

    Comment

    • PRR
      Recognized Expert Contributor
      • Dec 2007
      • 750

      #3
      You will have to specify the element name for encryption... Take a look at Encrypt XML Elements with Symmetric Keys and
      Decrypt XML Elements with Symmetric Keys

      You can encrypt webconfig for ASP.NET web app too...

      Comment

      • sammartin
        New Member
        • Mar 2009
        • 4

        #4
        use something like this,

        try
        {
        doc.LoadXml(you rXmlStringStrin g);
        XmlNode node = doc.SelectSingl eNode("root_doc ument_node/myfirstnode);
        if (node != null)
        { // node.InnerText contain the contents of the node
        }
        }
        catch {}

        xml example:
        <root_document_ node><myfirstno de>stuff here</myfirstnode></root_document_n ode>

        HTH
        Sam

        Comment

        • sammartin
          New Member
          • Mar 2009
          • 4

          #5
          Note: missing double quote from end of first parameter of SelectSingleNod e

          Comment

          Working...