C#中使用split分割字符串的几种方法- -
第一种方法:string s=abcdeabcdeabcde;string[] sArray=s.Split('c') ;foreach(string i in sArray)Console.WriteLine(i.ToString());
输出结果:
ab deab deab de
其他方法http://blog.csdn.net/leeharry/article/details/2281325
实现gridview点击行触发事件
protected void GridView2_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { string id = GridView2.DataKeys[e.NewSelectedIndex].Value.ToString(); //编写SQL语句查询当前选中的文件的文件名title字段 string sql = "select title from filepath where id=" + id; //调用公共类中的getTier方法获取视频的审核状态 string title = BaseClass.getOut(sql); string[] array = title.Split('.');//split方法分割字符串 string title2=array[0]; string doc = "~\\officeroot\\" + title; string swf = "~\\swfroot\\" + title2+"asas.swf"; ConvertPdfToSwf(doc, swf); System.Threading.Thread.Sleep(8000); FileInfo file = new FileInfo(Server.MapPath(swf));//判断格式转换后的文件是否存在 if (file.Exists) { Response.Write("