Click here to Skip to main content
15,910,411 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to stop VS to load user controls into toolbox? Pin
Morven Huang29-Apr-09 17:08
Morven Huang29-Apr-09 17:08 
GeneralRe: How to stop VS to load user controls into toolbox? Pin
Luc Pattyn29-Apr-09 17:10
sitebuilderLuc Pattyn29-Apr-09 17:10 
QuestionRemoving duplicates from large text files (Performance needed) Pin
Ehsan Baghaki29-Apr-09 14:12
Ehsan Baghaki29-Apr-09 14:12 
AnswerRe: Removing duplicates from large text files (Performance needed) Pin
Luc Pattyn29-Apr-09 15:04
sitebuilderLuc Pattyn29-Apr-09 15:04 
GeneralRe: Removing duplicates from large text files (Performance needed) [modified] Pin
Ehsan Baghaki29-Apr-09 22:28
Ehsan Baghaki29-Apr-09 22:28 
GeneralRe: Removing duplicates from large text files (Performance needed) Pin
Luc Pattyn30-Apr-09 1:14
sitebuilderLuc Pattyn30-Apr-09 1:14 
GeneralRe: Removing duplicates from large text files (Performance needed) Pin
Ehsan Baghaki30-Apr-09 2:58
Ehsan Baghaki30-Apr-09 2:58 
AnswerRe: Removing duplicates from large text files (Performance needed) Pin
Doug Goulden29-Apr-09 15:17
Doug Goulden29-Apr-09 15:17 
To make it fairly simple, us a generic dictionary where each url key and an entry into the database. Read each line of the textfile one at a time and verify that the key doesn't exist if it doesn't add it to the dictionary. If the key does exist then ignore it. When you are all done use the foreach to go through each key writing it to a file as text.

Something like

Dictionary<string, string=""> Urls = new Dictionary<string, string="">();
while(TextReader.Read())
{
string key = TextReader.ReadLline();
if(!Urls.ContainsKey(key))
{
Urls.Add(key,key);
}
}
foreach(string s in Urls.Keys)
{
TextWriter.WriteLine(s);
}

Obviously you need to do all of the opening and closing of files, but this is probably the simplest way.
QuestionMessage Removed Pin
29-Apr-09 11:39
professionalN_tro_P29-Apr-09 11:39 
AnswerRe: How to Load data into user settings Pin
DaveyM6929-Apr-09 12:07
professionalDaveyM6929-Apr-09 12:07 
AnswerRe: How to Load data into user settings Pin
Henry Minute29-Apr-09 13:10
Henry Minute29-Apr-09 13:10 
QuestionUm... it works when I F5 but not when I CTRL - F5...? Pin
Edmundisme29-Apr-09 11:27
Edmundisme29-Apr-09 11:27 
AnswerRe: Um... it works when I F5 but not when I CTRL - F5...? Pin
Eddy Vluggen29-Apr-09 12:45
professionalEddy Vluggen29-Apr-09 12:45 
GeneralRe: Um... it works when I F5 but not when I CTRL - F5...? Pin
Edmundisme29-Apr-09 12:47
Edmundisme29-Apr-09 12:47 
QuestionC# - File Permission Pin
malharone29-Apr-09 10:44
malharone29-Apr-09 10:44 
AnswerRe: C# - File Permission Pin
Jimmanuel29-Apr-09 11:19
Jimmanuel29-Apr-09 11:19 
AnswerRe: C# - File Permission Pin
Luc Pattyn29-Apr-09 11:33
sitebuilderLuc Pattyn29-Apr-09 11:33 
GeneralRe: C# - File Permission Pin
malharone29-Apr-09 13:17
malharone29-Apr-09 13:17 
QuestionHelp with Web Service Upload Pin
charles Frank29-Apr-09 10:16
charles Frank29-Apr-09 10:16 
QuestionHow can I use cookies stored by Internet Explorer 7(in Vista) in my WinForms application? Pin
rebulanyum29-Apr-09 10:08
rebulanyum29-Apr-09 10:08 
AnswerRe: How can I use cookies stored by Internet Explorer 7(in Vista) in my WinForms application? Pin
Henry Minute29-Apr-09 10:59
Henry Minute29-Apr-09 10:59 
AnswerRe: How can I use cookies stored by Internet Explorer 7(in Vista) in my WinForms application? [modified] Pin
rebulanyum30-Apr-09 4:36
rebulanyum30-Apr-09 4:36 
QuestionWhy pictures aren't shown in listview Pin
Aljaz11129-Apr-09 9:06
Aljaz11129-Apr-09 9:06 
AnswerRe: Why pictures aren't shown in listview Pin
Henry Minute29-Apr-09 9:34
Henry Minute29-Apr-09 9:34 
GeneralRe: Why pictures aren't shown in listview Pin
Aljaz11129-Apr-09 9:47
Aljaz11129-Apr-09 9: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.