1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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. wagnerk
    Highly Decorated Member Award

    wagnerk aka kitkatninja Moderator

    10,831
    357
    341
    If this is copied out of a copyrighted book, please remove.

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

    -Ken
     
    Certifications: CITP, PGCert, BSc, HNC, LCGI, PTLLS, MCT, MCITP, MCTS, MCSE, MCSA:M, MCSA, MCDST, MCP, MTA, MCAS, MOS (Master), A+, N+, S+, ACA, VCA, etc... & 2nd Degree Black Belt
    WIP: PGDip
  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

    dmarsh Terabyte Poster

    3,782
    302
    184
    Certifications: CITP, BSc, HND, SCJP, SCJD, SCWCD, SCBCD, SCEA, N+, Sec+, Proj+, Server+, Linux+, MCTS, MCPD, MCSA, MCITP, CCDH
  5. marie

    marie New Member

    1
    0
    1

Share This Page

Loading...