我用C#做编程语言当我使用Directory.GetDirectories获取某个目录的子目录列表并使用foreach in循环显示出来的时候发现文件夹的循序是混乱的,比如001、002、003、004、005,可能排序成:003、001、002、004、005请问这个问题要如何解决?是否有其他函数代替呢?另外当我想得到某个文件夹下文件的数量的话一般是
int getfilecount(string gpath) {
string[] filelist = Directory.GetFiles(gpath);
return filelist.Length;
}
但如果文件数太多应该会消耗很大吧,有没有直接得到数量的函数呢?再有就是有关表单的问题我做了一组
<asp:RadioButton runat="server" id="中文1" GroupName="cname" ></asp:RadioButton>
<asp:RadioButton runat="server" id="中文2" GroupName="cname" ></asp:RadioButton>
递交以后通过
cname= Request["cname"];
得到选择项的ID值,但其中的中文不能正常显示或者干脆没有,这是为什么呢?有没有方法获取这样RadioButton的value值呢?(情况比较特殊,不能使用RadioButtonList)谢谢。
int getfilecount(string gpath) {
string[] filelist = Directory.GetFiles(gpath);
return filelist.Length;
}
但如果文件数太多应该会消耗很大吧,有没有直接得到数量的函数呢?再有就是有关表单的问题我做了一组
<asp:RadioButton runat="server" id="中文1" GroupName="cname" ></asp:RadioButton>
<asp:RadioButton runat="server" id="中文2" GroupName="cname" ></asp:RadioButton>
递交以后通过
cname= Request["cname"];
得到选择项的ID值,但其中的中文不能正常显示或者干脆没有,这是为什么呢?有没有方法获取这样RadioButton的value值呢?(情况比较特殊,不能使用RadioButtonList)谢谢。
My.Computer.FileSystem.GetDirectories( _
My.Computer.FileSystem.SpecialDirectories.MyDocuments, True, _
"*Logs*")
ListBox1.Items.Add(foundDirectory)
Next
自己编写一个函数排序
cname= Request["cname"];
cnname为获取的VALUES值,不是ID号
System.Web.UI.WebControls.ListItemCollection 必须具有类型为“System.Web.UI.WebControls.ListItem”的项。“asp:Table”的类型为“System.Web.UI.WebControls.Table”。类似下边的代码。 <asp:RadioButtonList id="RadioButtonList1" runat="server">
<asp:ListItem Value="">aa</asp:ListItem>
<asp:Table id="votelist" runat="server" Width="90%" BackColor="Gray" CellPadding="5" CellSpacing="1">
<asp:TableRow runat="server" >
<asp:TableCell HorizontalAlign="Center" runat="server" BackColor="#f7f7f7" ColumnSpan="2">dd </asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:RadioButtonList>