第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

求1.asp如何獲取userlist 數(shù)據(jù)組?

求1.asp如何獲取userlist 數(shù)據(jù)組?

慕標(biāo)琳琳 2023-02-17 21:17:23
var submitForm = getNewSubmitForm("bl");createNewFormElement(submitForm, "name", 用戶名);createNewFormElement(submitForm, "pass", 密碼);createNewFormElement(submitForm, "port", roominfo.Port);createNewFormElement(submitForm, "gift_id", gift.g_giftid);createNewFormElement(submitForm, "gift_num", $("#ManyGifts_Num").val());createNewFormElement(submitForm, "userlist", list.trimEnd(","));submitForm.action = "http://1.asp";submitForm.submit()
查看完整描述

1 回答

?
翻翻過(guò)去那場(chǎng)雪

TA貢獻(xiàn)2065條經(jīng)驗(yàn) 獲得超14個(gè)贊

使用LINQ獲取列表中的某個(gè)字段值,下面以獲取員工列表中的編號(hào)字段為例子。

1、使用Select方法

[csharp] view plain copy
List<Emplayee> emplayeeList = GetEmplayeeList(); //獲取員工信息列表  
int[] empIds = emplayeeList.Select(a => a.Id).ToArray(); //獲取員工編號(hào)數(shù)組  
2、使用ForEach方法

[csharp] view plain copy
List<Emplayee> emplayeeList = GetEmplayeeList(); //獲取員工信息列表  
string empIds = "";  
emplayeeList.ForEach(a => empIds += a.Id + ",");  
empIds = empIds.TrimEnd(',');  
Console.WriteLine(empIds); //輸出:1,2,3  

其它代碼:
[csharp] view plain copy
/// <summary>  
/// 員工信息類  
/// </summary>  
public class Emplayee  
{
/// <summary>
/// 編號(hào)
/// </summary>
public int Id { get; set; }

/// <summary>
/// 姓名
/// </summary>
public string Name { get; set; }  
}  
[csharp] view plain copy
/// <summary>  
/// 獲取員工信息列表  
/// </summary>  
/// <returns></returns>  
public static List<Emplayee> GetEmplayeeList()  
{
List<Emplayee> emplayeeList = new List<Emplayee>();
Emplayee emplayee1 = new Emplayee() { Id = 1, Name = "張三" };
Emplayee emplayee2 = new Emplayee() { Id = 2, Name = "李四" };
Emplayee emplayee3 = new Emplayee() { Id = 3, Name = "王五" };
emplayeeList.Add(emplayee1);
emplayeeList.Add(emplayee2);
emplayeeList.Add(emplayee3);
return emplayeeList;  
}


查看完整回答
反對(duì) 回復(fù) 2023-02-20
  • 1 回答
  • 0 關(guān)注
  • 146 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)