博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
数组排序将111001000011排序到数组中list[0]=1,list[1]=1..........
阅读量:5033 次
发布时间:2019-06-12

本文共 3820 字,大约阅读时间需要 12 分钟。

///         /// 数组排序将111001000011排序到数组中list[0]=1,list[1]=1..........        ///         ///         /// 
public static string[] GetList(string str) { List
strList = new List
(); for (int i = 0; i <= str.Length - 1; i += 1) { strList.Add(str.Substring(i, 1)); } if (str.Length % 1 != 0) { strList.Add(str.Substring(str.Length - str.Length % 1)); } return strList.ToArray(); } ///
/// 将DO1事件复选排列到数组中 /// ///
private CheckBox[] InitiCheckList() { CheckBox[] check = new CheckBox[32]; try { check[0] = this.DO1_Event0; check[1] = this.DO1_Event1; check[2] = this.DO1_Event2; check[3] = this.DO1_Event3; check[4] = this.DO1_Event4; check[5] = this.DO1_Event5; check[6] = this.DO1_Event6; check[7] = this.DO1_Event7; check[8] = this.DO1_Event8; check[9] = this.DO1_Event9; check[10] = this.DO1_Event10; check[11] = this.DO1_Event11; check[12] = this.DO1_Event12; check[13] = this.DO1_Event13; check[14] = this.DO1_Event14; check[15] = this.DO1_Event15; check[16] = this.DO1_Event16; check[17] = this.DO1_Event17; check[18] = this.DO1_Event18; check[19] = this.DO1_Event19; check[20] = this.DO1_Event20; check[21] = this.DO1_Event21; check[22] = this.DO1_Event22; check[23] = this.DO1_Event23; check[24] = this.DO1_Event24; check[25] = this.DO1_Event25; check[26] = this.DO1_Event26; check[27] = this.DO1_Event27; check[28] = this.DO1_Event28; check[29] = this.DO1_Event29; check[30] = this.DO1_Event30; check[31] = this.DO1_Event31; } catch (Exception) { MessageBox.Show("超出索引"); } return check; } ///
/// 获取DO1事件,降序排列字符串 /// private void GetCheckedDO1_Event() { try { string conversion = null; string show = Convert.ToString(UInt32.Parse(label1.Text), 2); for (int j = show.Length - 1; j >= 0; j--) { conversion = conversion + show.Substring(j, 1); } for (int i = 0; i < conversion.Length; i++) { if (conversion[i].ToString() == "1") { InitiCheckList()[i].Checked = true; } else { InitiCheckList()[i].Checked = false; } } //for (int i = 0; i < show.Length; i++) //{ // if (show[i].ToString() == "1") // { // InitiCheckList()[i].Checked = true; // } // else // { // InitiCheckList()[i].Checked = false; // } //} } catch(Exception e) { MessageBox.Show(e.Message); } }

 

转载于:https://www.cnblogs.com/dangqinghua/articles/3070421.html

你可能感兴趣的文章
[Java in NetBeans] Lesson 06. Custom classes
查看>>
[AngularFire2 & Firestore] Example for collection and doc
查看>>
[Javascript] The "this" keyword
查看>>
ElasticSearch-5.3.1集群环境搭建,安装ElasticSearch-head插件,安装错误解决
查看>>
sharepoint Report使用共享数据源部署报错
查看>>
C++ Primer 5th 第16章 模板与泛型编程
查看>>
22个Web 在线编辑器[转]
查看>>
解决“The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path”问题...
查看>>
T-SQL语句学习(一)
查看>>
装箱拆箱(一)
查看>>
Python3 PyMySQL 的使用
查看>>
11个审查Linux是否被入侵的方法
查看>>
CentOS6.7源码安装MySQL5.6
查看>>
android Bitmap总结
查看>>
触发器简介
查看>>
JAVA反射机制的学习
查看>>
mysql - rollup 使用
查看>>
Chrome系列 Failed to load resource: net::ERR_CACHE_MISS
查看>>
出现函数重载错误call of overloaded ‘printfSth(double)’ is ambiguous
查看>>
SDUT 1941-Friday the Thirteenth(水)
查看>>