易截截图软件、单文件、免安装、纯绿色、仅160KB

一小段关键词分析代码(VB)

帮朋友改的一小段关键词分析代码; 含两个单词复合计数
Private Function CollectWords() As Dictionary(Of String, Integer)
'Create a new dictionary
Dim table As New Dictionary(Of String, Integer)
'Prompt for the user
Console.WriteLine(
"Enter a line : ")
'Get the user's input
Dim input As String = Console.ReadLine()
'Split the line and make an array of words
Dim words As String() = input.Split()
Dim wordPrev As String = ""
'Search the array
For Each word In words
'We can get the lowercase, not necessary here
Dim wordKey As String = word.ToLower()
'If the dictionay contains the words
If table.ContainsKey(wordKey) Then
'increment
table(wordKey) = table(wordKey) + 1
Else
'add a new word with a count of 1 in the dictionary
table.Add(wordKey, 1)
End If
Dim wordKey2 As String = (wordPrev + " " + word).ToLower()
If wordPrev <> "" Then
If table.ContainsKey(wordKey2) Then
'increment
table(wordKey2) = table(wordKey2) + 1
Else
'add a new word with a count of 1 in the dictionary
table.Add(wordKey2, 1)
End If
End If
wordPrev = word
Next
Return table
End Function


相关文档:

Asp.net 文件上传(Vb.net版)

在Asp.net中实现文件的上传功能,是非常简单的一件事情,只需要利用微软提供的FileUpload控件即可轻松实现。
LargeFileUpload.aspx代码如下
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="LargeFileUpload.aspx.vb"
    Inherits="LargeFileUpload" %>
<!DOCTYPE html PUBLIC "-//W3C/ ......

VB 读指定行

http://zhidao.baidu.com/question/81532606.html
VB 读指定行
悬赏分:10 - 解决时间:2009-1-20 11:41
vb中如何读取指定行的内容,窗体上有两个标签,文件在C:\A.TXT,四个按钮,单击第一个,读文件的第一行到标签一,第二行到标签二;单击第二个按钮,第三行到标签一,第四行到标签二;以此类推,谢谢
提问者: im ......

VB 使用WMI编程讲座(二)

五、 CIM储存库和CIM类(1)
    上一讲我们介绍了WMI的体系结构,还记得那张体系结构图吗?记得我们说到关注的重点应该是CIM储存库和WMI脚本对象库,为什么我们这样说呢?因为我们的程序直接是利用WMI脚本对象库进行编程,而这个WMI脚本对象获取或操作的内容都是来自CIM储存库(注意:我们这里说的CIM储存 ......

vb 创建快捷方式 兼容vista XP

'创建快捷方式,兼容vista
'要把vb6stkit.DLL放到程序目录
'敖士伟 09-10-27
'只对“桌面”和“开启”有效,其它还没做
'=========开启外部同步程序定义开始
Const SYNCHRONIZE = &H100000
Const INFINITE = &HFFFF 'Wait forever
Const WAIT_OBJECT_0 = 0 'The state of the spe ......

VB使用ActiveX控件实例和步聚

目的掌握一个简单的VB程序的建立、编辑、调试、运行和保存的方法。
操作步骤 ⑴进入VB环境,新建工程。方法是:如果出现“新建工程”对话框,则选择“标准.EXE”并点击[打开]按纽;或者直接点击菜单[文件]-[新建工程]。都会出现一个名为“Form1”的新窗体。
⑵从标准控件工具栏中向窗体加 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号