Click here to Skip to main content
15,893,266 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to open a word document from C# application Pin
seeism20-Jul-10 1:25
seeism20-Jul-10 1:25 
GeneralRe: How to open a word document from C# application Pin
seeism20-Jul-10 19:00
seeism20-Jul-10 19:00 
QuestionError Getting Processor Id Pin
PDTUM19-Jul-10 13:44
PDTUM19-Jul-10 13:44 
AnswerRe: Error Getting Processor Id Pin
Luc Pattyn19-Jul-10 14:20
sitebuilderLuc Pattyn19-Jul-10 14:20 
GeneralRe: Error Getting Processor Id Pin
PDTUM19-Jul-10 16:50
PDTUM19-Jul-10 16:50 
Questionnode hottracking Pin
xilefxilef19-Jul-10 12:39
xilefxilef19-Jul-10 12:39 
Questionpass resource name as variable Pin
Jassim Rahma19-Jul-10 12:21
Jassim Rahma19-Jul-10 12:21 
AnswerRe: pass resource name as variable Pin
Luc Pattyn19-Jul-10 12:40
sitebuilderLuc Pattyn19-Jul-10 12:40 
QuestionCreating a function using Dictionary and Datetime help?? Pin
roman_s19-Jul-10 9:25
roman_s19-Jul-10 9:25 
AnswerRe: Creating a function using Dictionary and Datetime help?? Pin
Luc Pattyn19-Jul-10 9:36
sitebuilderLuc Pattyn19-Jul-10 9:36 
GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
roman_s19-Jul-10 9:47
roman_s19-Jul-10 9:47 
GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
Luc Pattyn19-Jul-10 9:58
sitebuilderLuc Pattyn19-Jul-10 9:58 
GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
roman_s19-Jul-10 10:52
roman_s19-Jul-10 10:52 
GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
Luc Pattyn19-Jul-10 11:22
sitebuilderLuc Pattyn19-Jul-10 11:22 
GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
DaveyM6919-Jul-10 10:02
professionalDaveyM6919-Jul-10 10:02 
If the filename will always be in the format
name_yyyyMMdd_HHmm.extension

then you could use something like this (needs some [alot of] optimization but works). You can now implement a custom comparer to compare by name and if eqaul, compare by date.
C#
// string wrapper for filename format 'name_yyyyMMdd_HHmm.ext'
public class MyFileData
{
    private string fullname;

    public MyFileData(string fullname)
    {
        this.fullname = fullname;
    }

    public string Fullname
    {
        get { return fullname; }
    }
    public string Name
    {
        get { return fullname.Substring(0, fullname.IndexOf('_')); }
    }
    public DateTime DateTime
    {
        get { return DateTime.ParseExact(fullname.Substring(fullname.IndexOf('_') + 1, 13), "yyyyMMdd_HHmm", CultureInfo.InvariantCulture); }
    }
    public string Extension
    {
        get { return fullname.Substring(fullname.IndexOf(".") + 1); }
    }
}

Dave

If this helped, please vote & accept answer!


Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
roman_s19-Jul-10 10:46
roman_s19-Jul-10 10:46 
AnswerRe: Creating a function using Dictionary and Datetime help?? Pin
Luc Pattyn19-Jul-10 11:15
sitebuilderLuc Pattyn19-Jul-10 11:15 
GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
roman_s20-Jul-10 3:35
roman_s20-Jul-10 3:35 
GeneralRe: Creating a function using Dictionary and Datetime help?? Pin
Luc Pattyn20-Jul-10 4:22
sitebuilderLuc Pattyn20-Jul-10 4:22 
Questiongeneric List - Remove Duplicates Pin
Kevin Marois19-Jul-10 7:15
professionalKevin Marois19-Jul-10 7:15 
AnswerRe: generic List - Remove Duplicates Pin
Ennis Ray Lynch, Jr.19-Jul-10 7:20
Ennis Ray Lynch, Jr.19-Jul-10 7:20 
GeneralRe: generic List - Remove Duplicates Pin
Kevin Marois19-Jul-10 7:22
professionalKevin Marois19-Jul-10 7:22 
GeneralRe: generic List - Remove Duplicates Pin
DaveyM6919-Jul-10 7:56
professionalDaveyM6919-Jul-10 7:56 
AnswerRe: generic List - Remove Duplicates Pin
Luc Pattyn19-Jul-10 10:36
sitebuilderLuc Pattyn19-Jul-10 10:36 
QuestionImplementing database roles on menu and button level Pin
DotNetXenon19-Jul-10 6:30
DotNetXenon19-Jul-10 6:30 

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.