Chinaunix首页 | 论坛 | 博客
  • 博客访问: 196131
  • 博文数量: 106
  • 博客积分: 3810
  • 博客等级: 中校
  • 技术积分: 1007
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-18 13:35
文章分类

全部博文(106)

文章存档

2014年(17)

2011年(5)

2010年(75)

2009年(9)

我的朋友

分类:

2010-04-26 17:27:41


Imports System
Imports System.Windows.Forms
Imports System.Threading

' 此类定义压缩界面程序所使用到的各个 ZipConstants 常数。

NotInheritable Class ZipConstants

    Private Sub New()

    End Sub 'New

    ' 表示采用 Deflate 的压缩方式。
    Public Const DEFLATE As Byte = 4
    ' 表示采用 Gzip 的压缩方式。
    Public Const GZIP As Byte = 6
    ' 标头的修正部分。
    Public Const FixedHeaderSize As Integer = 30
    Public Const SuperHeaderSize As Integer = 3

    Public Const AddFiles As String = "添加文件并压缩"
    Public Const NewArchive As String = "建立一个新的压缩文件"
    Public Const OpenArchive As String = "打开一个现有的压缩文件"
    ' 文件的扩展名。
    Public Const Extension As String = "xip 文件(*.xip)|*.xip"
    Public Const AllExtensions As String = "所有文件 (*.*)|*.*"

    Public Const BackSlash As String = "\"
    Public Const Dot As String = "." '更多.net源码和教程,来自[乐博网 www.lob.cn]

    Public Const ExtractMessage As String = "成功地将文件解压缩至 {0} "
    Public Const OpenMessage As String = "打开既存的压缩文件 {0} 来加以编辑"
    Public Const NewMessage As String = "打开新的压缩文件 {0} 来加以编辑"
    Public Const AddMessage As String = "已将文件压缩并新增至压缩盘"

    Public Const Title As String = "压缩范例"
    Public Const GzipName As String = "GZip"
    Public Const DeflateName As String = "Deflate"
    Public Const ErrorName As String = "错误"

    Public Const SeekError As String = "尝试从开头之前搜寻"
    Public Const IOError As String = "发生一个 IO 错误"
    Public Const CloseError As String = "资料流已经关闭"
    Public Const MemoryError As String = "内存不足"
    Public Const ArgumentError As String = "自变量无效"
    Public Const FileNotFoundError As String = "找不到文件"
    Public Const FileError As String = "文件名称无效"
    Public Const CorruptedError As String = "尝试读取一个毁损的 xip 文件"
    Public Const FileExistsError As String = "文件已经存在"

    Public Const FileReplace As String = "乐博网提示:此文件已经存在,您要覆盖它吗?"
    Public Const Replace As String = "替换"

    Public Shared Sub ShowError(ByVal [error] As String)
        Dim opt As MessageBoxOptions
        If Thread.CurrentThread.CurrentUICulture.TextInfo.IsRightToLeft = True Then
            opt = MessageBoxOptions.RightAlign Or MessageBoxOptions.RtlReading
        Else
            opt = MessageBoxOptions.DefaultDesktopOnly
        End If
        MessageBox.Show([error], ErrorName, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, opt)
        CH2_DemoForm002.statusMessage = String.Empty

    End Sub 'ShowError
End Class 'ZipConstants


阅读(324) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~