开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 1725|回复: 1
收起左侧

[C#源码] LISTARRAY 泛型动态数组

[复制链接]
结帖率:33% (3/9)
发表于 2013-4-28 20:30:30 | 显示全部楼层 |阅读模式   四川省成都市
1.png

1.png
[e]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Diagnostics;
struct Rect
{
    int a;
    int b;
    int c;
    int d;
}

namespace LISTARRAY
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        const string Lin = "零";

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Text = "演示ListArray应用";
            ArrayList CodeArray = new ArrayList(); //动态数组
            Random Random =new Random();
            int index = Random.Next(1,100);
            object Object = new object();
            ListBox listBoxA = new ListBox();
            listBoxA = this.listBox1;
            for (int i = 0; i < index; ++i)
            {
                string 样本采集器;
                样本采集器 = i.ToString();
                Object = swap(样本采集器.ToCharArray());
                switch ((int)Object)
                {
                    case 1:
                        CodeArray.Add(cmcc(样本采集器, (int)Object));
                        break;
                    case 2:
                        CodeArray.Add(cmcc(样本采集器, (int)Object));
                        break;
                    default:
                        CodeArray.Add(cmcc(样本采集器, (int)Object));
                        break;
                }

            }
            if (CodeArray.Count <= 0)
            {
              MessageBox.Show("无法演示", "信息:");
              return;
            }
            Debug.Write (CodeArray);
            for (int i = 0; i <= CodeArray.Count-1;i++)
            {
                    listBoxA.Items.Add(CodeArray.ToString());
            }
        }
        private object swap(char []a)
        {
            return (object)(a.Length);
        }
        private string cmcc(string str,int inc)
        {
            string[] 样本采集器 = {"零", "一","二","三","四","五","六","七","八","九"};
            string[] 字样采集器 = { "个","十","百"};
            char[] 寄存器;
            string tmp;
            if (inc == 1)
            {
                return 样本采集器[Int32.Parse(str)];

            }
            else if (inc == 2)
            {
                寄存器 = str.ToCharArray();
                tmp = 样本采集器[Int32.Parse(Convert.ToString(寄存器[1]))];
                Debug.Write(tmp);
                if (tmp == Lin)
                {
                    return 样本采集器[Int32.Parse(Convert.ToString(寄存器[0]))] + 字样采集器[inc - 1];
                }
                else
                {
                    return 样本采集器[Int32.Parse(Convert.ToString(寄存器[0]))] + 字样采集器[inc - 1] + 样本采集器[Int32.Parse(Convert.ToString(寄存器[1]))];
                }

            }
            else
            {
                寄存器 = str.ToCharArray();
                return 样本采集器[Int32.Parse(Convert.ToString(寄存器[0]))] + 字样采集器[inc - 1];
            }

        }
    }
}

[/e]

LISTARRAY.rar (42.59 KB, 下载次数: 2)
结帖率:100% (6/6)
发表于 2013-4-28 20:45:09 | 显示全部楼层   福建省泉州市
下载不了 是我电脑问题还是bug
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 诚聘英才| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 800073686,邮箱:800073686@b.qq.com
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表