標籤
.net
(
17
)
工作
(
29
)
面試
(
2
)
筆記
(
2
)
筆記倉庫
(
1
)
嘸蝦米
(
2
)
繪圖
(
1
)
Add-on
(
4
)
Android
(
39
)
AngularJS
(
1
)
ASP.NET
(
14
)
AutoHotKey
(
20
)
AutoIt
(
3
)
batch
(
24
)
Blogger Hack
(
3
)
Bookmarklet
(
18
)
C#
(
16
)
Chrome
(
1
)
cmd
(
22
)
CSS
(
6
)
CSS3
(
6
)
D855
(
1
)
DOM
(
17
)
DragOnIt
(
5
)
EmEditor
(
1
)
English
(
1
)
ffmpeg
(
1
)
Firefox
(
25
)
flo
(
2
)
GIMP
(
1
)
gist
(
144
)
Graphviz
(
1
)
hardware
(
1
)
HDD
(
1
)
HTML5
(
4
)
i18n
(
1
)
IIS
(
4
)
ImageMagick
(
5
)
Java
(
1
)
JavaScript
(
92
)
jhead
(
1
)
jQuery
(
6
)
JSBin
(
19
)
jsFiddle
(
4
)
JSON
(
1
)
JustDoubleClick
(
1
)
Kindle
(
1
)
MSSQL
(
26
)
MySQL
(
2
)
Network
(
1
)
node.js
(
12
)
php
(
1
)
PowerShell
(
6
)
ramdisk
(
1
)
Reg
(
3
)
RegExp
(
3
)
rpi3
(
3
)
SJ2000
(
1
)
SQLite
(
3
)
SSD
(
1
)
Stylish
(
1
)
SublimeText
(
2
)
tips
(
6
)
userChrome.js
(
3
)
userscript
(
40
)
VB.net
(
9
)
VBScript
(
2
)
VisualStudio
(
2
)
Vue.js
(
3
)
Win
(
5
)
Win2008
(
1
)
Win7
(
29
)
WinAPI
(
1
)
Winform
(
1
)
WinXP
(
3
)
XML
(
1
)
GridView Container.DataItemIndex 用法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:GridView ID="GridView1" runat="server" EnableModelValidation="True"> | |
<Columns> | |
<asp:TemplateField> | |
<ItemTemplate> | |
<%# Container.DataItemIndex + 1 %> | |
</ItemTemplate> | |
</asp:TemplateField> | |
<asp:TemplateField> | |
<ItemTemplate> | |
<asp:Button ID="Button1" runat="server" CommandName="ShowRowIndex" Text="Click" CommandArgument='<%# Container.DataItemIndex %>' /> | |
</ItemTemplate> | |
</asp:TemplateField> | |
</Columns> | |
</asp:GridView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Protected Sub GridView1_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GridView1.RowCommand | |
If (e.CommandName = "ShowRowIndex") Then | |
Response.Write(Convert.ToInt32(e.CommandArgument)) | |
End If | |
End Sub |
File Filter (async & sync)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'), | |
path = require('path'), | |
strWorkPath = 'E:/Test', | |
aryFolderPath = fs.readdirSync(strWorkPath); | |
for (var i = 0; i < aryFolderPath.length; i++) { | |
//判斷是資料夾 | |
if (fs.statSync(path.join(strWorkPath, aryFolderPath[i])).isDirectory()) { | |
//撈出全部檔案 | |
var files = fs.readdirSync(path.join(strWorkPath, aryFolderPath[i])); | |
//過濾jpg檔 | |
files.map(function(file) { | |
return path.join(strWorkPath, aryFolderPath[i], file); | |
}).filter(function(file) { | |
return fs.statSync(file).isFile() && path.extname(file) === '.jpg'; | |
}).forEach(function(file) { | |
console.log(file); | |
}); | |
} | |
} | |
/* Reslut | |
E:\Test\FolderA\1.jpg | |
E:\Test\FolderB\2.jpg | |
E:\Test\FolderC\3.jpg | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E:\TEST | |
├─FolderA | |
│ ├─1.jpg | |
│ └─FileA.txt | |
│ | |
├─FolderB | |
│ ├─2.jpg | |
│ └─FileA.txt | |
│ | |
└─FolderC | |
├─3.jpg | |
└─FileB.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'), | |
path = require('path'), | |
strWorkPath = 'E:/Test'; | |
fs.readdir(strWorkPath, function(err, folders) { | |
if (err) { | |
throw err; | |
} | |
folders.map(function(folder) { | |
return path.join(strWorkPath, folder); | |
}).filter(function(folder) { | |
return fs.statSync(folder).isDirectory(); | |
}).forEach(function(folder) { | |
fs.readdir(folder, function(err, files) { | |
if (err) { | |
throw err; | |
} | |
files.map(function(file) { | |
return path.join(folder, file); | |
}).filter(function(file) { | |
return fs.statSync(file).isFile() && path.extname(file) === '.jpg'; | |
}).forEach(function(file) { | |
console.log(file); | |
}); | |
}); | |
}); | |
}); | |
/* Reslut | |
E:\Test\FolderA\1.jpg | |
E:\Test\FolderB\2.jpg | |
E:\Test\FolderC\3.jpg | |
*/ |
訂閱:
文章
(
Atom
)