我正在自杀并脱水试图让这个数组排序.
我有一个包含生成的目录的数组;
Dim Folders()As String = Directory.GetDirectories(RootPath)
我需要对它们进行排序,以便它们在win7/vista中的Windows资源管理器中显示. - 文件夹名称的数字和字母顺序.
文件夹名称包含字母和数字,有时仅包含字母或仅包含数字.
简单的Array.Sort(文件夹)结果
C:\inetpub\wwwroot\rootpath\1
C:\inetpub\wwwroot\rootpath\10
C:\inetpub\wwwroot\rootpath\100
C:\inetpub\wwwroot\rootpath\1004
C:\inetpub\wwwroot\rootpath\101
C:\inetpub\wwwroot\rootpath\11
C:\inetpub\wwwroot\rootpath\12
C:\inetpub\wwwroot\rootpath\2
C:\inetpub\wwwroot\rootpath\3
C:\inetpub\wwwroot\rootpath\4
C:\inetpub\wwwroot\rootpath\5
C:\inetpub\wwwroot\rootpath\6
C:\inetpub\wwwroot\rootpath\7
C:\inetpub\wwwroot\rootpath\8
C:\inetpub\wwwroot\rootpath\87skjnd
C:\inetpub\wwwroot\rootpath\89sdf93kmw3
C:\inetpub\wwwroot\rootpath\9
C:\inetpub\wwwroot\rootpath\ad
C:\inetpub\wwwroot\rootpath\bin
C:\inetpub\wwwroot\rootpath\dark
C:\inetpub\wwwroot\rootpath\erk
C:\inetpub\wwwroot\rootpath\jkh23978yoaslkd3
C:\inetpub\wwwroot\rootpath\lk2309as
C:\inetpub\wwwroot\rootpath\work
C:\inetpub\wwwroot\rootpath\zone
Run Code Online (Sandbox Code Playgroud)
我想拥有的(以及Windows资源管理器显示的内容)是......
C:\inetpub\wwwroot\rootpath\1
C:\inetpub\wwwroot\rootpath\2
C:\inetpub\wwwroot\rootpath\3
C:\inetpub\wwwroot\rootpath\4
C:\inetpub\wwwroot\rootpath\5
C:\inetpub\wwwroot\rootpath\6
C:\inetpub\wwwroot\rootpath\7
C:\inetpub\wwwroot\rootpath\8
C:\inetpub\wwwroot\rootpath\9
C:\inetpub\wwwroot\rootpath\10
C:\inetpub\wwwroot\rootpath\11
C:\inetpub\wwwroot\rootpath\12
C:\inetpub\wwwroot\rootpath\87skjnd
C:\inetpub\wwwroot\rootpath\89sdf93kmw3
C:\inetpub\wwwroot\rootpath\100
C:\inetpub\wwwroot\rootpath\101
C:\inetpub\wwwroot\rootpath\1004
C:\inetpub\wwwroot\rootpath\ad
C:\inetpub\wwwroot\rootpath\bin
C:\inetpub\wwwroot\rootpath\dark
C:\inetpub\wwwroot\rootpath\erk
C:\inetpub\wwwroot\rootpath\jkh23978yoaslkd3
C:\inetpub\wwwroot\rootpath\lk2309as
C:\inetpub\wwwroot\rootpath\work
C:\inetpub\wwwroot\rootpath\zone
Run Code Online (Sandbox Code Playgroud)
我用Google搜索并发现需要编写一个使用IComparable对类进行排序的类.作为超级新手...我真的不知道如何做到这一点.我看过的大多数例子都有多维数组和键:S ......
如果排序可以应用于文件名数组(而不是foldernames)或包含文件夹和文件的数组,那将会更好......在这种情况下,排序的文件夹显示在顶部,排序的文件显示在下面......这是甚至可能?
任何帮助都将受到极大关注......:谢谢.
我有一个使用Win7和IIS7设置的本地开发Web服务器.
我经常需要使用"非常慢"的互联网连接来测试我在所有浏览器上开发的应用程序和网站,以确定所有客户端脚本的执行方式,以及图像和所有链接资源是否正确加载并按顺序在所有浏览器上加载.
现在,这涉及将项目部署到远程服务器,然后通过慢速Internet或网络连接进行测试.在我的情况下,这通常只能在项目结束时进行.每隔一段时间部署项目一次只是为了速度测试......
是否可以减慢IIS的速度,使其表现得像是通过非常慢的Internet连接进行连接并以这种方式测试应用程序.这也将帮助我测试独立PC(没有PC网络)上的应用程序,例如家庭桌面上没有网络连接的互联网连接.
对不起,听起来是新手!......无法帮助因为我是一个:)
谢谢,诺曼.
更新:几乎所有这个问题的答案都很棒并且在不同的情况下工作....对我来说(Win7上的IIS7)选择的答案是最合适的......我相信你会在这里找到一个适合的答案你:).所以感谢大家......哦......如果下一个版本的IIS或VS带有磁铁,请不要感到惊讶!:d
我一直在javascript中使用它们......真的不知道区别.谷歌搜索总是显示"窗口对象"或"在javascript中打开一个新窗口"的结果,所以在那里找不到任何东西.
eval("v"+e)
window["v"+e]
Run Code Online (Sandbox Code Playgroud)
有时窗口适合我,有时候eval工作....
那么eval()和window []之间的区别是什么?
抱歉新手问题!
诺曼
我有以下对象
{
"locations": {
"Base 1": {
"title": "This is base 1",
"Suburb 1": {
"title": "Suburb 1 in Base 1",
"Area A": {
"title": "Title for Area A",
"Street S1": {
"title": "Street S1 title"
},
"Street C4": {
"title": "Street C4 title"
},
"Street B7": {
"title": "Street B7 title"
}
},
"Another Area": {
"title": "Title for Area A",
"Street S1": {
"title": "Street S1 title"
},
"Street C4": {
"title": "Street C4 title"
},
"Street B7": …Run Code Online (Sandbox Code Playgroud) 我一直在我的代码中使用eval,最近我发现可能存在严重的安全问题如果在Javascript中使用了eval().最常见的情况是我使用eval()来组成变量名,然后像这里获取该变量的值;
var a = "2" // could be any value
work(a);
function work(a)
{
var l1 = "something";
var l2 = "something else";
var l3 = "something different";
alert(eval("l"+a));
// alerts "something else"
};
Run Code Online (Sandbox Code Playgroud)
在这样的情况下,有没有替代eval()?
我已经尝试使用窗口["l"+ a],但只有在变量是全局变量且document.getElementById("l"+ a)并且不起作用时才会起作用.
任何帮助非常感谢.
谢谢,诺曼.
我一直在寻找方法来做这几天......它真的杀了我......任何人,请帮忙.
我想在DNN(VB)中创建一个新模块......
1. does not use DAL or DAL+
2. has only one view.ascx control
3. It has to be a compiled module
Run Code Online (Sandbox Code Playgroud)
我不需要数据库连接和任何铃声和口哨只是一个视图控件.我认为这很简单,但谷歌搜索一天,它似乎很复杂.
任何愿意一步一步发布的人都会很棒......
I have the development environment already set up with;
1. DNN Starter kit
2. VS 2008
3. SQL server
4. DNN up and running in IIS
5. the project builds successfully
Run Code Online (Sandbox Code Playgroud)
如果有人知道我可以使用VS 2008中的DNN动态模块模板构建模块,然后剥离DAL和所有不必要的层和额外的控件,直到我只有一个工作的view.ascx打印出"Hello World! " 到屏幕......那太好了!
非常感谢Norman.
PS :(我也在adefwebserver.com(http://www.adefwebserver.com/DotNetNukeHELP/DNN5_HelloWorld/Default.htm)尝试了hello world教程 - 并且该向导不会像在教程中那样出现.)