Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to get ports using in the local machie Pin
leppie10-Nov-08 23:52
leppie10-Nov-08 23:52 
QuestionCreating forum Pin
B8710-Nov-08 22:20
B8710-Nov-08 22:20 
AnswerRe: Creating forum Pin
Simon P Stevens10-Nov-08 22:27
Simon P Stevens10-Nov-08 22:27 
AnswerRe: Creating forum Pin
Mohammad Dayyan10-Nov-08 22:47
Mohammad Dayyan10-Nov-08 22:47 
GeneralRe: Creating forum Pin
leppie11-Nov-08 0:05
leppie11-Nov-08 0:05 
GeneralRe: Creating forum Pin
Mohammad Dayyan11-Nov-08 0:34
Mohammad Dayyan11-Nov-08 0:34 
GeneralRe: Creating forum Pin
Paul Conrad11-Nov-08 6:17
professionalPaul Conrad11-Nov-08 6:17 
Questionusing System.IO ----- File.Encrypt(); Pin
jas0n2310-Nov-08 22:14
jas0n2310-Nov-08 22:14 
Hi all!

I am just playing around trying to learn more about C# and I wrote the contents of textBox1.Text to a file on my hard drive using System.IO, the following way:

string[] lines = new string[] { textBox1.Text };
string filepath = "C:\\Users\\Jase\\JTS\\myfile.txt";
File.WriteAllLines(filepath, lines);


..And it works perfectly. But when I started to type the word File (at the beginning of File.Write AllLines.) the IDE IntelliSense thing popped up and I noticed there is an Encrypt option. Then it got me thinking... Does this actually encrypt the file? I tried the following code to encrypt but does not work:

string[] lines = new string[] { textBox1.Text };
string filepath = "C:\\Users\\Jase\\JTS\\myfile.txt";
File.Encrypt(filepath, lines);



Does anybody have any thoughts/ideas/suggestions? I've looked on Google and MSDN and some other forums and haven't found anything that helps. I'd appreciate any help that I can get Smile | :) .

Thanks for readin'.

j.t.
AnswerRe: using System.IO ----- File.Encrypt(); Pin
Guffa10-Nov-08 22:24
Guffa10-Nov-08 22:24 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
jas0n2310-Nov-08 22:41
jas0n2310-Nov-08 22:41 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
N a v a n e e t h10-Nov-08 22:46
N a v a n e e t h10-Nov-08 22:46 
AnswerRe: using System.IO ----- File.Encrypt(); Pin
N a v a n e e t h10-Nov-08 22:25
N a v a n e e t h10-Nov-08 22:25 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
jas0n2310-Nov-08 22:50
jas0n2310-Nov-08 22:50 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
J4amieC10-Nov-08 23:08
J4amieC10-Nov-08 23:08 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
N a v a n e e t h10-Nov-08 23:19
N a v a n e e t h10-Nov-08 23:19 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
jas0n2311-Nov-08 0:03
jas0n2311-Nov-08 0:03 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
Mark Churchill11-Nov-08 16:40
Mark Churchill11-Nov-08 16:40 
GeneralRe: using System.IO ----- File.Encrypt(); Pin
jas0n2312-Nov-08 4:43
jas0n2312-Nov-08 4:43 
QuestionSelectedValue.ToString() Pin
Melanie Booysen10-Nov-08 21:30
Melanie Booysen10-Nov-08 21:30 
AnswerRe: SelectedValue.ToString() Pin
J a a n s10-Nov-08 21:51
professionalJ a a n s10-Nov-08 21:51 
GeneralRe: SelectedValue.ToString() Pin
Melanie Booysen10-Nov-08 21:55
Melanie Booysen10-Nov-08 21:55 
AnswerRe: SelectedValue.ToString() Pin
N a v a n e e t h10-Nov-08 22:13
N a v a n e e t h10-Nov-08 22:13 
GeneralRe: SelectedValue.ToString() Pin
Melanie Booysen10-Nov-08 22:23
Melanie Booysen10-Nov-08 22:23 
GeneralRe: SelectedValue.ToString() Pin
N a v a n e e t h10-Nov-08 22:28
N a v a n e e t h10-Nov-08 22:28 
GeneralRe: SelectedValue.ToString() Pin
Melanie Booysen10-Nov-08 22:47
Melanie Booysen10-Nov-08 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.