Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamically declared
Message
De
21/06/2013 12:11:56
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01576814
Message ID:
01576822
Vues:
46
>>Hi,
>>
>>I have code like this:
>>
>>
            NetworkCredential cred = new NetworkCredential(smtpUser, smtpPassword);
>>            NetworkCredential cred1 = new NetworkCredential(justUser + "1" + justCredDomain, smtpPassword);
>>            NetworkCredential cred2 = new NetworkCredential(justUser + "2" + justCredDomain, smtpPassword);
>>            NetworkCredential cred3 = new NetworkCredential(justUser + "3" + justCredDomain, smtpPassword);
>>            NetworkCredential cred4 = new NetworkCredential(justUser + "4" + justCredDomain, smtpPassword);
>>
>>
>>How can I make this flexible where I can switch from 5 variables to 7 or whatever amount I want?
>>
>>I then need to use these in a loop where I send emails from different email address each pass through the loop. For example, first pass uses cred, second cred1, 3rd Cred2, etc and then when cred4 is reached the next loop would be cred again.
>>
>>I suppose some type of collection? Can anyone give me an example showing how to declare these and how to use them in later code? I am using C#.
>>
>>Thanks
>
>One possibility is to create a List of that type.

thank you
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform