Click here to Skip to main content
16,004,828 members
Home / Discussions / C#
   

C#

 
GeneralRe: If new drive detected.. an event happens Pin
Silvyster4-Dec-08 23:48
Silvyster4-Dec-08 23:48 
GeneralRe: If new drive detected.. an event happens Pin
Luc Pattyn5-Dec-08 1:44
sitebuilderLuc Pattyn5-Dec-08 1:44 
AnswerRe: If new drive detected.. an event happens Pin
Simon P Stevens5-Dec-08 1:58
Simon P Stevens5-Dec-08 1:58 
Question.net remoting Pin
krinaljariwala4-Dec-08 19:42
krinaljariwala4-Dec-08 19:42 
AnswerRe: .net remoting Pin
leppie4-Dec-08 20:20
leppie4-Dec-08 20:20 
GeneralRe: .net remoting Pin
krinaljariwala4-Dec-08 21:03
krinaljariwala4-Dec-08 21:03 
GeneralRe: .net remoting Pin
leppie5-Dec-08 0:41
leppie5-Dec-08 0:41 
QuestionLoad data from .txt file to listbox problem. Pin
irsalina4-Dec-08 19:01
irsalina4-Dec-08 19:01 
I want to load data that have already saved in a file to a listbox. My code here doesn't work, there's nothing happen in the listbox eventhough there are some items in the file that should be loaded to the listbox. Where is my mistake?

//the code below to load, but nothing happen
private const string Filename = "DDBlock.txt";
public void Main(String[] args)
{
this.listBoxBlockedNumberDD.Items.Clear();
if (File.Exists(Filename) == true)
{
using (StreamReader sr = File.OpenText(Convert.ToString(Filename)))
{
foreach (string Item in Filename)
{
listBoxBlockedNumberDD.Items.Add(sr.ReadLine());
}
}
}
}

//the code below to save item in listbox to a file, it works and the item is saved to the file.
private void menuItemDD_Click(object sender, EventArgs e)
{
listBoxBlockedNumberDD.Items.Add(RemoveText(textBoxPhoneNumber1.Text.Trim()));
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(Filename, true))
{
foreach (string Item in this.listBoxBlockedNumberDD.Items)
{
sw.WriteLine(Item);
}
sw.Close();
}
textBoxPhoneNumber1.Text = string.Empty;
}
AnswerRe: Load data from .txt file to listbox problem. Pin
Christian Graus4-Dec-08 19:04
protectorChristian Graus4-Dec-08 19:04 
QuestionRe: Load data from .txt file to listbox problem. Pin
irsalina7-Dec-08 20:56
irsalina7-Dec-08 20:56 
QuestionHow to delete data from listbox and then, delete that item in file txt? Pin
irsalina4-Dec-08 18:55
irsalina4-Dec-08 18:55 
AnswerRe: How to delete data from listbox and then, delete that item in file txt? Pin
Christian Graus4-Dec-08 19:02
protectorChristian Graus4-Dec-08 19:02 
QuestionMulticolumn Textbox Pin
SelvaSR4-Dec-08 17:53
SelvaSR4-Dec-08 17:53 
AnswerRe: Multicolumn Textbox Pin
CodingYoshi4-Dec-08 18:33
CodingYoshi4-Dec-08 18:33 
AnswerRe: Multicolumn Textbox Pin
Tamer Oz4-Dec-08 20:37
Tamer Oz4-Dec-08 20:37 
AnswerRe: Multicolumn Textbox Pin
Thomas Stockwell5-Dec-08 7:14
professionalThomas Stockwell5-Dec-08 7:14 
QuestionHow to create a makefile for the project-in VS C# 2005 Pin
TJS4u4-Dec-08 17:41
TJS4u4-Dec-08 17:41 
AnswerRe: How to create a makefile for the project-in VS C# 2005 Pin
leppie4-Dec-08 18:51
leppie4-Dec-08 18:51 
QuestionInstanting a class with no constructor Pin
K. Shaffer4-Dec-08 16:57
K. Shaffer4-Dec-08 16:57 
AnswerRe: Instanting a class with no constructor Pin
CodingYoshi4-Dec-08 17:32
CodingYoshi4-Dec-08 17:32 
GeneralRe: Instanting a class with no constructor Pin
K. Shaffer4-Dec-08 17:50
K. Shaffer4-Dec-08 17:50 
AnswerRe: Instanting a class with no constructor Pin
PIEBALDconsult4-Dec-08 17:32
mvePIEBALDconsult4-Dec-08 17:32 
GeneralRe: Instanting a class with no constructor Pin
leppie4-Dec-08 18:52
leppie4-Dec-08 18:52 
AnswerRe: Instanting a class with no constructor Pin
Christian Graus4-Dec-08 18:53
protectorChristian Graus4-Dec-08 18:53 
QuestionTaskManager - trojans Pin
nelsonpaixao4-Dec-08 14:25
nelsonpaixao4-Dec-08 14:25 

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.