Nån som kan översätta det här till VB?? Jag gör ett försök direkt ifrån huvudet :-)från C# till VB
// Find the people who were born today
List<ProfileCommon> FindBirthDayPeople()
{
// Use a generic list of people
List<ProfileCommon> birthdayPeople = new List<ProfileCommon>();
// Get all profile objects
ProfileInfoCollection profiles = ProfileManager.GetAllProfiles();
// Go through the profiles
foreach (ProfileInfo info in profiles)
{
// We need to turn a ProfileInfo into a ProfileCommon
// to access the properties to do the search
ProfileCommon userProfile = ProfileCommon.Create(info.UserName);
// If the birthday matches
if (userProfile.BirthDate.Day == DateTime.Today.Day &&
userProfile.BirthDate.Month == DateTime.Today.Month)
{
// Add them to our list
birthdayPeople.Add(userProfile);
}
}
return birthdayPeople;
}Sv: från C# till VB
// Find the people who were born today
Public Function FindBirthDayPeople() as List(of ProfileCommon)
// Use a generic list of people
Dim birthdayPeople as new List(of ProfileCommon)
// Get all profile objects
Dim profiles as ProfileInfoCollection = ProfileManager.GetAllProfiles();
// Go through the profiles
for each info as ProfileInfo in profiles
// We need to turn a ProfileInfo into a ProfileCommon
// to access the properties to do the search
dim userProfile as ProfileCommon = ProfileCommon.Create(info.UserName);
// If the birthday matches
if userProfile.BirthDate.Day = DateTime.Today.Day AND _
userProfile.BirthDate.Month = DateTime.Today.Month)
// Add them to our list
birthdayPeople.Add(userProfile);
End If
Next
Return birthdayPeople;
End Function