MCTS 70-536 Exam Help!! Encoding Issue

Discussion in 'MCAD / MCSD / MCPD' started by Newbie Developer, Jul 14, 2009.

  1. Newbie Developer

    Newbie Developer New Member

    2
    0
    1
    Hi,

    I am currently working through exam 70-536 of the MCTS cert and would be grateful if someone could provide me with some assistance in one of the lab exercises.

    In chapter 3 exercise 1, I am required to create a console application that will convert a text file (win.ini) to UTF-7 encoding.

    The C# code for this is as follows:-

    StreamReader sr = new StreamReader(@"C:\windows\win.ini");
    StreamWriter sw = new StreamWriter("win-utf7.txt", false, Encoding.UTF7);
    sw.WriteLine(sr.ReadToEnd());
    sw.Close();
    sr.Close();

    I have tried to run this code and included the System.IO namespace, however I get the following error:-

    "The type or namespace name 'UTF7' does not exist in the namespace 'Encoding' (are you missing an assembly reference?)"

    If a reference is required, I am not sure how to add this, can someone please point me in the right direction?

    Kind regards


    New Developer
     
  2. Kitkatninja
    Highly Decorated Member Award 500 Likes Award

    Kitkatninja aka me, myself & I Moderator

    11,143
    559
    383
    If this is copied out of a copyrighted book, please remove.

    Apart from that, take a look here as this may help.

    -Ken
     
    Certifications: MSc, PGDip, PGCert, BSc, HNC, LCGI, MBCS CITP, MCP, MCSA, MCSE, MCE, A+, N+, S+, Server+
    WIP: MSc Cyber Security
  3. Newbie Developer

    Newbie Developer New Member

    2
    0
    1
    That did not work.

    Which reference do I need to add?? as there are soo many!

    Kind regards

    Newbie Developer
     
  4. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
  5. marie

    marie New Member

    1
    0
    1

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.