Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to get string values out of a custom List with a loop...

$
0
0

OK, so I figured out how to create a list that holds two values per item.  I just don't know how to extract them later...  I pasted the custom class and the basic two commands I'm using to instantiate a list and add items.  Now, how to I loop through 'ss' and pull out only the "FullPath" string?  Thanks very much....Chris

List<FileNameAndPath> ss = new List<FileNameAndPath>();
ss.Add(new FileNameAndPath(strFile, System.IO.Path.GetFileName(strFile)));

public class FileNameAndPath
        {
            public FileNameAndPath(string FullPath, string FileName)
            {
                this.FullPath = FullPath;
                this.FileName = FileName;
            }
            public string FullPath { get; set; }
            public string FileName { get; set; }
        }


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>