Click here to Skip to main content
15,888,293 members
Home / Discussions / C#
   

C#

 
GeneralRe: common_documents folder Pin
Judah Gabriel Himango15-Apr-08 12:17
sponsorJudah Gabriel Himango15-Apr-08 12:17 
GeneralRe: common_documents folder Pin
Glen Harvy15-Apr-08 13:39
Glen Harvy15-Apr-08 13:39 
GeneralRe: common_documents folder Pin
Judah Gabriel Himango16-Apr-08 4:38
sponsorJudah Gabriel Himango16-Apr-08 4:38 
GeneralRe: common_documents folder Pin
Scott Dorman19-Apr-08 8:40
professionalScott Dorman19-Apr-08 8:40 
GeneralExtracting An IE shortcut's icon Pin
sagedread15-Apr-08 10:41
sagedread15-Apr-08 10:41 
GeneralRe: Extracting An IE shortcut's icon Pin
Judah Gabriel Himango15-Apr-08 11:50
sponsorJudah Gabriel Himango15-Apr-08 11:50 
GeneralRe: Extracting An IE shortcut's icon Pin
sagedread15-Apr-08 14:54
sagedread15-Apr-08 14:54 
GeneralRe: Extracting An IE shortcut's icon Pin
Judah Gabriel Himango16-Apr-08 4:30
sponsorJudah Gabriel Himango16-Apr-08 4:30 
sagedread wrote:
how would you search for the string representing the favicon.ico path?

In .NET 1 and .NET 2, you'd write it like this:
string iconFilePath = "";
string iconFileLabel = "IconFile="; 
foreach (string line in File.ReadAllLines(theFavoriteFilePathGoesHere))
{
     if (line.StartsWith(iconFileLabel))
     {
         iconFilePath = line.Remove(0, iconFileLabel.Length);
         break;
     }
}
Or if you're using the latest version of .NET, you could write this as a LINQ query:
var matchingLines = from line in File.ReadAllLines(favoriteFilePath)
                    let iconFileLabel = "IconFile="
                    where line.StartsWith(iconFileLabel)
                    select line.Remove(0, iconFileLabel.Length);

var iconFilePath = matchingLines.FirstOrDefault();






Tech, life, family, faith: Give me a visit.
I'm currently blogging about: I'm Offended That You're Offended!
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


QuestionHow to pass object array to unmanaged C++ Pin
Alan Balkany15-Apr-08 10:13
Alan Balkany15-Apr-08 10:13 
AnswerRe: How to pass object array to unmanaged C++ Pin
Alan Balkany15-Apr-08 11:10
Alan Balkany15-Apr-08 11:10 
GeneralRe: How to pass object array to unmanaged C++ Pin
Luc Pattyn15-Apr-08 13:29
sitebuilderLuc Pattyn15-Apr-08 13:29 
GeneralRe: How to pass object array to unmanaged C++ Pin
Alan Balkany16-Apr-08 3:49
Alan Balkany16-Apr-08 3:49 
Generalrdlc repoting - center image in picturebox Pin
AJ du Plessis15-Apr-08 8:38
AJ du Plessis15-Apr-08 8:38 
GeneralRe: rdlc repoting - center image in picturebox Pin
Alan N15-Apr-08 8:50
Alan N15-Apr-08 8:50 
GeneralRe: rdlc repoting - center image in picturebox Pin
AJ du Plessis15-Apr-08 9:01
AJ du Plessis15-Apr-08 9:01 
GeneralKeyboard hooks and sendinput.. Pin
Bakaneko15-Apr-08 6:26
Bakaneko15-Apr-08 6:26 
GeneralRe: Keyboard hooks and sendinput.. Pin
Anthony Mushrow15-Apr-08 7:00
professionalAnthony Mushrow15-Apr-08 7:00 
GeneralRe: Keyboard hooks and sendinput.. [modified] Pin
Bakaneko15-Apr-08 7:10
Bakaneko15-Apr-08 7:10 
GeneralRe: Keyboard hooks and sendinput.. Pin
Bakaneko15-Apr-08 11:57
Bakaneko15-Apr-08 11:57 
GeneralRe: Keyboard hooks and sendinput.. Pin
Bakaneko15-Apr-08 12:55
Bakaneko15-Apr-08 12:55 
QuestionUpdate/Refresh Form Pin
Alessandra7715-Apr-08 5:41
Alessandra7715-Apr-08 5:41 
GeneralRe: Update/Refresh Form Pin
Waleed Eissa15-Apr-08 5:56
Waleed Eissa15-Apr-08 5:56 
GeneralRe: Update/Refresh Form Pin
Alessandra7715-Apr-08 6:04
Alessandra7715-Apr-08 6:04 
GeneralRe: Update/Refresh Form Pin
Waleed Eissa15-Apr-08 6:06
Waleed Eissa15-Apr-08 6:06 
GeneralRe: Update/Refresh Form Pin
Alessandra7715-Apr-08 6:24
Alessandra7715-Apr-08 6:24 

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.