惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
J
Java Code Geeks
I
InfoQ
腾讯CDC
Vercel News
Vercel News
IT之家
IT之家
V
Visual Studio Blog
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 叶小钗
有赞技术团队
有赞技术团队
月光博客
月光博客
Martin Fowler
Martin Fowler
量子位
L
LangChain Blog
B
Blog
Last Week in AI
Last Week in AI
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

博客园 - 天生舞男

多个平均数列的子查询 迁移sharepoint Sharepoint迁移数据库之绝版(只要照着做,一定能够迁移成功) Sharepoint的webpart 虚函数和非虚函数的调用基本原则 The visio to drawing project chart. - 天生舞男 Using MSChart from a C# WinForm About the deeply copy 学习程序的自我建议---从实际软件的源代码开始学习 MS bug "The connection pool" in Oracle 10g and the data sort according to specified filed on DataGrid control. How to get response content with specified post data by post method Post method tip automation服务器不能创建对象 Get the biggest common divisor rose破解 Recently expection RadioButtonList中选择框和文字对不齐的解决办法 resolve problem best method is find document from official document 看了宝玉的作品,心理甚是感叹
ArrayList按Index删除的问题
天生舞男 · 2006-02-15 · via 博客园 - 天生舞男

问题一:
删除了不该删除的记录。
// 应该删除第2,3 条记录,结果删除的是第2,4条记录。因为删除第2条记录时,第4条记录会挤入第
// 三条,结果它Index为2.
int nIndex1 = 1;
int nIndex2 = 2;
alPhoneName = dataSourcePhone.CreatePhoneArrayList();
dataSourcePhone.DeletePhoneByIndex(alPhoneName, nIndex1);
dataSourcePhone.DeletePhoneByIndex(alPhoneName, nIndex2);
dgPhone.DataSource = dataSourcePhone.CreatPhoneDataSource(alPhoneName);
dgPhone.DataBind();

问题二:
// 删除倒数第二和倒数第一的问题

办法:
办法一:从索引大的往索引小的删
办法二:按ArrayList中的值来删除。