Click here to Skip to main content
15,905,781 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# and SQL Project Pin
Michael Fritzius23-Jan-09 4:26
professionalMichael Fritzius23-Jan-09 4:26 
AnswerRe: C# and SQL Project Pin
Michael Fritzius26-Jan-09 3:57
professionalMichael Fritzius26-Jan-09 3:57 
QuestionGetDriveName in C# Pin
mulugheta22-Jan-09 4:00
mulugheta22-Jan-09 4:00 
AnswerRe: GetDriveName in C# Pin
Ben Fair22-Jan-09 4:04
Ben Fair22-Jan-09 4:04 
GeneralRe: GetDriveName in C# Pin
mulugheta22-Jan-09 4:13
mulugheta22-Jan-09 4:13 
GeneralRe: GetDriveName in C# Pin
Ben Fair22-Jan-09 4:34
Ben Fair22-Jan-09 4:34 
GeneralRe: GetDriveName in C# Pin
EliottA22-Jan-09 5:01
EliottA22-Jan-09 5:01 
QuestionHow do i retrieve the directory of multiple images file without hard code ? Pin
Lim Yuxuan22-Jan-09 3:45
Lim Yuxuan22-Jan-09 3:45 
Hi. I had a photo album project and I was wondering is there anyway to retrieve the directory of images with minimum hardcoding ?

What I am currently doing now is this :


//prefix of the directory of large images
const string strLargePrefix = "/images/large/";

//suffix of the directory of large images
const string strLargeSuffix = "_large.jpg";

//group the pictures together with each of them assigned with a reference number
enum enuImages
{
//note that the first image will have its reference number
//as its position number-1.Example: 2nd image = 2-1 = reference number 1
cHTP3 =0, //1st image
cppHTP4 = 1, //second image
csharpFEP1 = 2,//third image
jHTP4 = 3, //4th image
jwsFEP1 =4, //5th image
vbnetFEP1 = 5 //6th image
}

RetrieveData()
{
// An enumeration object that represents the images based on their
// reference number. Initial reference set to 1st image

enuImages m_Images = 0;

//Array index of the image to be stored at base on their reference number.
//Index number has the same value as reference number.

int intIndex = 0;

//Retrieve directory path of the Large images and sort them
for (intIndex = 0; intIndex < int_TotalImages; intIndex++ )
{
strLargeImage[intIndex] = Directory.GetCurrentDirectory() +
strLargePrefix + m_Images + strLargeSuffix;
m_Images++;//increment the reference number to represent next image
}// end for loop
}


I dont really like the idea of grouping the images together because I have to hard code the names of the image file. But I have no choice as it works with the for loop. Is there any method that behaves like the file.ReadAllLines() that can retrieve all the images from that folder and return them as a form of array ?
AnswerRe: How do i retrieve the directory of multiple images file without hard code ? Pin
Ben Fair22-Jan-09 4:11
Ben Fair22-Jan-09 4:11 
GeneralRe: How do i retrieve the directory of multiple images file without hard code ? Pin
Lim Yuxuan22-Jan-09 15:13
Lim Yuxuan22-Jan-09 15:13 
QuestionHow to upload an email in to VSS through Dotnet coding Pin
mforMurali22-Jan-09 2:43
mforMurali22-Jan-09 2:43 
AnswerRe: How to upload an email in to VSS through Dotnet coding Pin
Wendelius22-Jan-09 3:17
mentorWendelius22-Jan-09 3:17 
QuestionHow to count a string for \ character? Pin
Matjaz-xyz22-Jan-09 2:08
Matjaz-xyz22-Jan-09 2:08 
AnswerRe: How to count a string for \ character? Pin
Rob Philpott22-Jan-09 2:23
Rob Philpott22-Jan-09 2:23 
AnswerRe: How to count a string for \ character? Pin
Matjaz-xyz22-Jan-09 2:36
Matjaz-xyz22-Jan-09 2:36 
GeneralRe: How to count a string for \ character? Pin
J4amieC22-Jan-09 2:41
J4amieC22-Jan-09 2:41 
GeneralRe: How to count a string for \ character? Pin
Matjaz-xyz22-Jan-09 3:48
Matjaz-xyz22-Jan-09 3:48 
GeneralRe: How to count a string for \ character? Pin
Ben Fair22-Jan-09 4:31
Ben Fair22-Jan-09 4:31 
AnswerRe: How to count a string for \ character? Pin
Jon Rista22-Jan-09 4:58
Jon Rista22-Jan-09 4:58 
AnswerRe: How to count a string for \ character? [modified] Pin
Luc Pattyn22-Jan-09 9:26
sitebuilderLuc Pattyn22-Jan-09 9:26 
Questionhow to make a value in an excel cell read only using c#? Pin
abhiram_nayan22-Jan-09 1:54
abhiram_nayan22-Jan-09 1:54 
AnswerRe: how to make a value in an excel cell read only using c#? Pin
Dave Kreskowiak22-Jan-09 7:06
mveDave Kreskowiak22-Jan-09 7:06 
GeneralRe: how to make a value in an excel cell read only using c#? Pin
abhiram_nayan22-Jan-09 19:17
abhiram_nayan22-Jan-09 19:17 
GeneralRe: how to make a value in an excel cell read only using c#? Pin
Dave Kreskowiak23-Jan-09 2:26
mveDave Kreskowiak23-Jan-09 2:26 
GeneralRe: how to make a value in an excel cell read only using c#? Pin
abhiram_nayan23-Jan-09 2:47
abhiram_nayan23-Jan-09 2: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.