12 2012 档案
摘要:见下列代码: static void Main(string[] args) { int[,] a = new int[,] { { 0, 1, 2, 3 }, { 2, 3, 4, 5 }, { 3, 4, 5, 6 } }; Console.WriteLine("规则数组:"); Console.WriteLine(a.Length); Console.WriteLine(a.GetLength(0)); Console.WriteLine(a.GetL...
阅读全文
摘要:winfrom导入excel内容,要求能够excel中多个工作簿的内容。代码如下:#region 导入excel数据 private void button2_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "表格文件 (*.xls)|*.xls"; openFileDialog.RestoreDirectory = t...
阅读全文
摘要:Java中的string拥有CharAt()方法,C#是不拥有的,为了使用方便,我们自己可以写一个。using System; namespace Company{ public class TestMain{ static void Main(){ string str = "abcdefg"; string n_str = str.CharAt(3); Console.WriteLine(n_str); } } public static class...
阅读全文
摘要:考虑到很多数据源是不确定的,所以这时无法在前台设置gridview的表头,需要在后台动态指定并绑定数据。前台代码如下:<%@ Page Title="主页" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><asp:Content ID="HeaderContent
阅读全文

浙公网安备 33010602011771号