浅谈文字编码和Unicode(上) [转]

出处:http://blog.csdn.net/fmddlmyy/archive/2007/02/14/1510189.aspx

我曾经写过一篇《谈谈Unicode编码,简要解释UCS、UTF、BMP、BOM等名词》(以下简称《谈谈Unicode编码》),在网上流传较广,我也收到不少朋友的反馈。本文探讨《谈谈Unicode编码》中未介绍或介绍较少的代码页、Surrogates等问题,补充一些Unicode资料,顺带介绍一下我最近编写的一个Unicode工具:UniToy。本文虽然是前文的补充,但在写作上尽量做到独立成篇。

标题中的“浅谈”是对自己的要求,我希望文字能尽量浅显易懂。但本文还是假设读者知道字节、16进制,了解《谈谈Unicode编码》中介绍过的字节序和Unicode的基本概念。

0 UniToy  UniToy是我编写的一个小工具。通过UniToy,我们可以全方位、多角度地查看Unicode,了解Unicode和语言、代码页的关系,完成一些文字编码的相关工作。本文的一些内容是通过UniToy演示的。大家可以从我的网站(www.fmddlmyy.cn)下载UniToy的演示版本。 1 文字的显示1.1 发生了什么?

继续阅读浅谈文字编码和Unicode(上) [转]

彻底移除 Windows 10 的 OneDrive

来源:http://bbs.pcbeta.com/viewthread-1740194-1-3.html

1、移除资源管理器导航栏的 OneDrive

将下列内容存为RemoveOneDrive.reg文件,并双击导入注册表

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000

2、完美卸载

按WIN+R,输入【cmd】,点“确定”,运行以下三个命令:

taskkill /f /im OneDrive.exe
%SystemRoot%\System32\OneDriveSetup.exe /uninstall   
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

如何彻底删除或卸载OneDrive
清理OneDrive残留数据。运行删除残余数据命令:

rd "%UserProfile%\OneDrive" /Q /S
rd "%LocalAppData%\Microsoft\OneDrive" /Q /S
rd "%ProgramData%\Microsoft OneDrive" /Q /S
rd "C:\OneDriveTemp" /Q /S

再运行注册表项删除命令:

REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG Delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

 

GridView.RowCount 与 GridView.DataRowCount 的区别

RowCount

GridView.RowCount Property | WinForms Controls | DevExpress Help

This property overrides the BaseView.RowCount property to increment its value in the following cases:

NoteDetail pattern Views do not contain data and they are never displayed within XtraGrid. So, the RowCount member must not be invoked for these Views. The RowCount member can only be used with real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.

DataRowCount

BaseView.DataRowCount Property | WinForms Controls | DevExpress Help

Note that data rows can be hidden within collapsed groups when data grouping is applied. The DataRowCount property returns the total number of data rows regardless of whether they are within collapsed groups or not. Also, the property’s return value is not always the same as the number of records within the associated data source. When data filtering is applied, the DataRowCount property returns the number of rows that match the filter condition.

NoteDetail pattern Views do not contain data and they are never displayed within XtraGrid. So, the DataRowCount member must not be invoked for these Views. The DataRowCount member can only be used with real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.

试比较:

Private Sub GridView1_MouseDown(sender As Object, e As MouseEventArgs) Handles GridView1.MouseDown
        Dim view As GridView = TryCast(sender, GridView)
        Dim hitInfo As GridHitInfo = view.CalcHitInfo(e.Location)
        Select Case hitInfo.HitTest
            Case GridHitTest.Column
                SelectColumn(view, hitInfo)
            Case Else                ' 
                view.OptionsSelection.MultiSelect = False
                view.OptionsSelection.MultiSelectMode = GridMultiSelectMode.RowSelect
        End Select
 End Sub

 Private Sub SelectColumn(ByRef View As GridView, ByRef hitinfo As GridHitInfo)
        '全选列(不排列)
        View.OptionsSelection.MultiSelect = True
        View.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect
        View.OptionsCustomization.AllowSort = False
        View.ClearSelection()

        View.SelectCells(New GridCell(0, hitinfo.Column), New GridCell(View.DataRowCount - 1, hitinfo.Column))
        View.OptionsCustomization.AllowSort = True
End Sub

 

addhanderl与handels区别

遇到一个问题。addhandler 与 handels的区别是什么

举例:如下语句运行成功

 Private Sub 供货商IDSearchLookUpEdit_TextChanged(sender As Object, e As EventArgs) Handles 供货商IDSearchLookUpEdit.TextChanged
        MsgBox(sender.name, MsgBoxStyle.OkCancel, "测试")
End Sub

如下语句不成功

Private Sub 主界面_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    AddHandler 供货商IDSearchLookUpEdit.TextChanged, AddressOf 供货商IDSearchLookUpEdit_TextChanged
end sub

Private Sub 供货商IDSearchLookUpEdit_TextChanged(sender As Object, e As EventArgs)
        'Handles 供货商IDSearchLookUpEdit.TextChanged
        MsgBox(sender.name, MsgBoxStyle.OkCancel, "测试")
End Sub

 

如何修改 cell 值

Private Sub GridView1_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs) Handles GridView1.CellValueChanged
        If e.Column.FieldName = "FieldName" Then
            GridView1.SetRowCellValue(e.RowHandle, "columnName", "value")
        End If
End Sub

注:千万必要写成以下形式,否则会引发System.StackOverflowException 异常

Private Sub GridView1_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs) Handles GridView1.CellValueChanged
        If GridView1.FocusedColumn.FieldName = "FieldName" Then
            GridView1.SetRowCellValue(e.RowHandle, "columnName", "value")
        End If
End Sub

相关链接:https://www.devexpress.com/Support/Center/Question/Details/T352822

【VB.NET】TabControl有关事件

事件: Deselecting               e.TabPage.Text=TabPage1
标签: SelectedTab               TabPage1
——————–
事件: Deselected               e.TabPage.Text=TabPage1
标签: SelectedTab               TabPage1
——————–
事件: Selecting               e.TabPage.Text=TabPage2
标签: SelectedTab               TabPage2
——————–
事件: Selected               e.TabPage.Text=TabPage2
标签: SelectedTab               TabPage2
——————–
事件: SelectedIndexChanged               TabPage2
标签: SelectedTab               TabPage2

WIN8 错误代码:720

来源:http://tieba.baidu.com/p/3261639822

在系统运行中使用 CMD 打开命令行模式。
使用REGEDIT 打开注册表编辑器。
找到以下注册表子项:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
请逐个查找每个子项,找到在右侧“DriverDesc”值数据为 “WAN微型端口(网络监视器)”的子项。(同理找到IP,IPV6)
将每个找到的子项中的“Characteristics” 值数据从29修改为9。(注意你要找到3个进行修改,因为你有三个感叹号)
此时,在系统设备管理器中就可以将问题项卸掉了。
再点击扫描,感叹号消失,拨号错误720也没有了

注:可能需要重启

解决 Windows 10 强制安装更新问题

Windows10不再允许关闭系统自动更新,也不允许选择是否更新微软提供的硬件驱动程序。
这造成了很多用户升级到Windows10,安装好驱动后(尤其显卡),不一会就被自动更新推送的驱动程序替换成微软的版本,让人烦恼。
事实证明,高级系统设置->系统属性->硬件->设备安装设置,”从不安装来自Windows更新的驱动程序软件“选项,不能有效阻止自动安装。
好在微软为有需要禁止自动更新的用户,提供了单独的工具。

解决方法:

1、(如果要隐藏的更新已经安装,需要先卸载该更新并重新启动计算机)
2、下载文章末尾的工具。如图所示,运行该工具,勾选需要隐藏的更新,一路下一步即可。

Show or Hide updates

傲游截图20150930232535

傲游截图20150930233038

傲游截图20150930235123
Show or Hide updates

相关页面:https://support.microsoft.com/en-us/kb/3073930
软件地址:http://download.microsoft.com/download/F/2/2/F22D5FDB-59CD-4275-8C95-1BE17BF70B21/wushowhide.diagcab