Access数据库怎么设置不打印标题?Access数据库打印的时候,想要设置不打印标题,该怎么设置呢?下面我们就来看看Access不打印标题的方法,需要的朋友可以参考下......
2023-01-15
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
'保存压缩文件
Dim fso As New SaveFileDialog
If fso.ShowDialog = Windows.Forms.DialogResult.OK Then
GzipFile(fso.FileName)
End If
End Sub
Private Sub GzipFile(ByVal FileName As String)
Try
'定义文件流,用于写入压缩流
Dim fs As FileStream = New FileStream(FileName, FileMode.Create, FileAccess.Write)
'定义压缩流,用于压缩数据
Dim compressStream = New GZipStream(fs, CompressionMode.Compress, False)
'定义写入操作流,用于向压缩流写入数据
Dim sw As StreamWriter = New StreamWriter(compressStream, System.Text.Encoding.GetEncoding("GB2312"))
sw.WriteLine(Me.RichTextBox1.Text)
sw.Close()
MsgBox("压缩文件成功")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Private Function Decompress(ByVal FileName As String)
Dim DeCompressStr As String = ""
'定义文件流,用于读取数据
Dim fs As New FileStream(FileName, FileMode.Open, FileAccess.Read)
'定义压缩流,用于解压缩,生成解压流
Dim DecomprssStream As New GZipStream(fs, CompressionMode.Decompress, False)
'定义读取操作流,用于从压缩流读取数据
Dim sr As New StreamReader(DecomprssStream, System.Text.Encoding.GetEncoding("GB2312"))
'返回读取出的内容()
DeCompressStr = sr.ReadToEnd
sr.Close()
Return DeCompressStr
End Function
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
'打开压缩的文件,以读取其内容
Dim fso As New OpenFileDialog
If fso.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.RichTextBox1.Text = Decompress(fso.FileName)
MsgBox("解压内容完成")
End If
End Sub
End Class
相关文章
Access数据库怎么设置不打印标题?Access数据库打印的时候,想要设置不打印标题,该怎么设置呢?下面我们就来看看Access不打印标题的方法,需要的朋友可以参考下......
2023-01-15
Access数据库报表怎么设置四页打印?Access中的报表想要打印成四页的效果,该怎么对打印进行设置呢?下面我们就来看看详细的教程,需要的朋友可以参考下......
2023-01-15
access分割窗体和空白窗体怎么创建?access中想要创建窗体,该怎么创建分割窗体和空白窗体呢?下面我们就来看看详细的教程,需要的朋友可以参考下......
2023-01-15
Access数据库表格怎么使用信纸进行打印?Access表格打印的额时候,想要使用信纸打印,该怎么设置呢?下面我们就来看看详细的教程,需要的朋友可以参考下......
2023-01-15