
asp.net 4.5 练习~test5-1
发布日期:2021-05-06 21:15:33
浏览次数:22
分类:技术文章
本文共 1304 字,大约阅读时间需要 4 分钟。
webform1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test5_1.WebForm1" %>
webform1.aspx.cs
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace test5_1{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btn_select_Click(object sender, EventArgs e) { int count = lbxSource.Items.Count; int index = 0; for (int i = 0; i < count; i++) { ListItem item = lbxSource.Items[index]; if (lbxSource.Items[index].Selected == true) { lbxDestnition.Items.Add(item); } index++; } //这段代码有缺陷,框1选中的国家,加入框2时,没有做重复项判断,所以会重复添加内容。 } }}
发表评论
最新留言
关注你微信了!
[***.104.42.241]2025年03月30日 15时04分24秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
FreeRTOS学习笔记(10)——中断管理
2019-03-03
CC2640R2F学习笔记(1)——搭建环境、编译烧写
2019-03-03
ESP8266学习笔记(10)——官方WebServer
2019-03-03
CC2640R2F学习笔记(6)——UART串口使用
2019-03-03
SHELL命令
2019-03-03
redis命令学习
2019-03-03
自然划分的3-4-5规则
2019-03-03
剑指offer Leetcode 37.序列化二叉树
2019-03-03
剑指offer Leetcode 39.数组中出现次数超过一半的数字
2019-03-03
Latex中cases环境引入报错
2019-03-03
Latex排版的时候把图片放在指定位置
2019-03-03
用 Python 把你的朋友变成表情包(鼠标事件提取 ROI 版)
2019-03-03
Tensorflow2.0:基于循环卷积网络预测剩余寿命
2019-03-03
bzoj3879: SvT 后缀自动机
2019-03-03
4084: [Sdoi2015]双旋转字符串
2019-03-03
bzoj3439: Kpm的MC密码(四种做法)
2019-03-03
Nginx出现500 Internal Server Error 错误
2019-03-03
pytorch loss = loss_func(output, label) 报错
2019-03-03
51nod 1526 分配笔名
2019-03-03
MySQL中drop、truncate和delete的区别?
2019-03-03