내 페이지로드에서 ReturnStuff()
번을 한 번 또는 3 번 호출합니까? 3 번 부르면 더 효율적인 방법이 있습니까?목록을 올바르게 사용하고 있습니까?
protected void Page_Load(object sender, EventArgs e)
{
string thing1 = ReturnStuff(username,password)[0];
string thing2 = ReturnStuff(username, password)[1];
string thing3 = ReturnStuff(username, password)[2];
}
public static List<string> ReturnStuff(string foo, string bar)
{
// Create a list to contain the attributes
List<string> Stuff = new List<string>();
// Some process that determines strings values based on supplied parameters
Stuff.Add(fn);
Stuff.Add(ln);
Stuff.Add(em);
return Stuff;
}
3 번이나 전화를 걸 었는지 여부를 묻습니다. –
네, 그게 어떻게 더 효율적으로 할 수 있습니다. – mmcglynn