6 Replies - 533 Views - Last Post: 28 May 2010 - 12:16 PM Rate Topic: -----

#1 ghqwerty  Icon User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 900
  • Joined: 08-August 08

trying to follow a tutorial

Posted 28 May 2010 - 10:05 AM

The name 'Directory' does not exist in the current context
The type or namespace name 'StreamWriter' could not be found (are you missing a using directive or an assembly reference?

i get these 2 errors when i try to follow thistutorial

here is the code it show up on

string current_source = richTextBox1.Text;

            StreamWriter stream = new StreamWriter("index.html");
            stream.Write(current_source);
            stream.Close();

            string place = Directory.GetCurrentDirectory();
            string url = place + "/index.html";

            webBrowser1.Navigate(url);



i am very new to c# so i dont know how to fix this. but im assuming its something to do with the include or references.
thanks

Is This A Good Question/Topic? 0
  • +

Replies To: trying to follow a tutorial

#2 prajayshetty  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 920
  • Joined: 27-April 07

Re: trying to follow a tutorial

Posted 28 May 2010 - 10:18 AM

add following lines before your namespace decleration

using System;
using System.Collections.Generic;

using System.Text;
using System.IO;


This post has been edited by prajayshetty: 28 May 2010 - 10:19 AM

Was This Post Helpful? 1
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: trying to follow a tutorial

Posted 28 May 2010 - 10:19 AM

You need a reference to the System.IO Namespace

prajayshetty For those errors he doesn't need to import all those Namespaces, just System.IO
Was This Post Helpful? 1
  • +
  • -

#4 ghqwerty  Icon User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 900
  • Joined: 08-August 08

Re: trying to follow a tutorial

Posted 28 May 2010 - 10:22 AM

thankyou.

another thing. in the richtext box is it possible to make it so that when the user presses tab it indents the text ?


---


found it by setting acceptsTab to true. however can i adjust the size of the tab ?

This post has been edited by ghqwerty: 28 May 2010 - 10:27 AM

Was This Post Helpful? 0
  • +
  • -

#5 prajayshetty  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 920
  • Joined: 27-April 07

Re: trying to follow a tutorial

Posted 28 May 2010 - 10:33 AM

here it is

     RichTextBox1.SelectionIndent=30
     RichTextBox1.SelectionHangingIndent=40
     RichTextBox1.SelectionRightIndent=50


This post has been edited by prajayshetty: 28 May 2010 - 10:33 AM

Was This Post Helpful? 0
  • +
  • -

#6 ghqwerty  Icon User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 900
  • Joined: 08-August 08

Re: trying to follow a tutorial

Posted 28 May 2010 - 10:42 AM

when i do that it doesnt seem to affect the size of the indentation.

also when i highlight some text and press tab, the cursor moves to the tab point but the text is deleted.
Was This Post Helpful? 0
  • +
  • -

#7 prajayshetty  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 920
  • Joined: 27-April 07

Re: trying to follow a tutorial

Posted 28 May 2010 - 12:16 PM

You will have to select the text for that buddy and then use your option because it works only for selected text.
You can also specify it in your code using selectionstart and selectionlength property.

This post has been edited by prajayshetty: 28 May 2010 - 12:16 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1