只是想学习VB.net。 制作一些列出文件夹和子文件夹中所有文件的文件夹。 在根C:\中有一个测试文件夹,在al文件夹中有2个子文件夹和som文件。 在执行列表框中填充了al文件,文件夹包括子文件夹和子文件夹中的文件。 但.. 如果id在G上选择一个文件夹:\的东西变得很奇怪,我只会列出几个文件夹或文件
这是我的第一个问题,所以如果搞砸了告诉你,我很抱歉
<meta charset="utf-8">
<title>Doodsoorzaak door huidkanker </title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.min.js" charset="utf-8"></script>
<!-- <link href="css/d3.min.css" rel="stylesheet" type="text/css"> -->
<link rel="stylesheet" href="css/colors.css" />
<link rel="stylesheet" href="css/height.css" />
<link rel="stylesheet" href="css/cssstyles.css" />
</script>
<style>
text {
font: 12px sans-serif;
}
svg {
display: block;
}
html, body, #chart1, svg {
margin: 0px;
padding: 0px;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<container>
</ul>
<header>
<nav class="col-xs-12 h300" class="navbar navbar-default navbar-inverse" role="navigation">
<div class="container-fluid">
<center><img id="logo" src="img/Logo.png" width="auto" height="auto" /></center>
<ul id="menu">
<center> <h4> De laatste jaren is het aantal sterfte gevallen door huidkanker toegenomen. Vooral 60-plussers sterven het vaakst door huidkanker.</h4> </center>
</ul>
</div>
</nav>
</header>
<body>
<div id="chart">
<svg></svg>
</div>
<script type="text/javascript">
nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.x(function(d) { return d.label }) //Specify the data accessors.
.y(function(d) { return d.value })
.staggerLabels(true) //Too many bars and not enough room? Try staggering labels.
.tooltips(false) //Don't show tooltips
.showValues(true) //...instead, show the bar value right on top of each bar.
.transitionDuration(350)
;
d3.select('#chart svg')
.datum(exampleData())
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
//Each bar represents a single discrete quantity.
function exampleData() {
return [
{
key: "Cumulative Return",
values: [
{
"label" : "Infectieuze en parasitaire ziekten" ,
"value" : 3104
} ,
{
"label" : "Ziekten van hart en vaatstelsel" ,
"value" : 37862
} ,
{
"label" : "Uitwendige oorzaken v. ziekte en sterfte" ,
"value" : 6813
}
]
}
]
}
</script>
</body>
<footer>
<section class="col-xs-12 h100">
<center>
<p>
<br><br>
Copyright Tufan Ugurel
</p>
</center>
</section>
<footer>
</container>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script href="js/d3.min.js"></script>
答案 0 :(得分:1)
默认情况下,字符串比较区分大小写。您将错过具有另一个案例的扩展,如CheckedListBox中所示。使用
If String.Compare(information.Extension, "." & strEXTENTIE, _
StringComparison.OrdinalIgnoreCase) = 0 Then
但如果您在浏览文件夹之前准备好扩展程序
,效率会更高'Outside of subroutines
Dim extensions As New HashSet(Of String)()
'In Button1_Click before calling Listfiles
For i As Integer = 0 To CheckedListBoxEXTENTIES.CheckedItems.Count - 1
extensions.Add("." & _
CheckedListBoxEXTENTIES.CheckedItems(i).ToString().ToLowerInvariant())
Next
然后你可以检查这样的扩展,而不必遍历每个文件的CheckedListBox。
If extensions.Contains(information.Extension.ToLowerInvariant()) Then