我想使用SevenZipsharp压缩卷中的文件,例如将100 mb的文件压缩为10个10 mb的文件.我们可以使用7zip.exe -volume参数来做同样的事情......
例如,当我使用7Zip压缩多卷时,我得到这些文件结构:
File.7z.001
File.7z.002
File.7z.003
etc...
Run Code Online (Sandbox Code Playgroud)
文件不是独立的,不是一个大小相同的7zip文件,是一个不同卷的压缩文件,我的意思是提取我们需要的第一个文件"File.7z.001"的整个内容
我想使用SevenZipSharp做同样的事情(如果可能的话).
我在vb.net中创建了这个片段(但不管答案是否在C#代码中),我需要实现多卷选项,我需要帮助:
Imports SevenZip
Dim dll As String = "7z.dll"
Private Function SevenZipSharp_Compress(ByVal Input_DirOrFile As String, _
Optional ByVal OutputFileName As String = Nothing, _
Optional ByVal Format As OutArchiveFormat = OutArchiveFormat.SevenZip, _
Optional ByVal CompressionMode As CompressionMode = CompressionMode.Create, _
Optional ByVal CompressionMethod As CompressionMethod = CompressionMethod.Lzma, _
Optional ByVal CompressionLevel As CompressionLevel = CompressionLevel.Normal, _
Optional ByVal Password As String = Nothing) As Boolean
Try
' Set library …Run Code Online (Sandbox Code Playgroud) 我试图在Windows 7 x64中编译VS2012中的项目.
尝试使用MsBuild 4.0在安装了Windows 7 x86和.Net framework 4.0的虚拟机中编译它,但是我收到有关"resgen.exe"和netfx工具3.5的错误:
"C:\Users\Administrador\AppData\Local\Temp\Virtuosa Game Packer\Virtuosa Game P
acker.sln" (default target) (1) ->
"C:\Users\Administrador\AppData\Local\Temp\Virtuosa Game Packer\Extractor.vbpro
j" (default target) (2) ->
(CoreResGen target) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2291,5
): error MSB3091: Task failed because "resgen.exe" was not found, or the correc
t Microsoft Windows SDK is not installed. The task is looking for "resgen.exe"
in the "bin" subdirectory beneath the location specified in the InstallationFol
der value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft S
DKs\Windows\v7.0A\WinSDK-NetFx35Tools-x86. You may be …Run Code Online (Sandbox Code Playgroud) 我有这些构建配置:
这些平台配置:
而这些编译条件:
NET40
NET45
Run Code Online (Sandbox Code Playgroud)
我的解决方案是一个庞大的API,包含20个解决方案,其中一些解决方案Async使用了只能从.NetFx 4.5获得的关键字和其他优势.
这部分代码我以这种方式在条件中:
#If NET45 then
Sub Async
...
End Sub
#Else
Sub
...
End Sub
#End If
Run Code Online (Sandbox Code Playgroud)
然后,我想要做的是清楚,.NetFx 4.5构建配置应该编译NET45条件的块,而.NetFx 4.0构建配置应该编译#Else部分的块.
我发现的问题是,如果我在项目设置中更改应用程序目标框架,则更改将在所有其他构建配置中保留,并且我希望避免持久性.
那我该怎么做呢?
注意:
我用C#标记标记了这个问题,因为它是一个一般的Visual Studio环境问题,但我会澄清我的解决方案是用Vb.Net编写的,因为我知道C#项目设置和它们的编译器参数之间有一些很大的区别所以也许C#高级答案无法帮助我.
我有一个带有RichTextBox控件的应用程序,其中一个过程几乎一直在添加文本:
RichTextBox1.Text += vbNewLine & "Title: " & AlbumName
RichTextBox1.Text += vbNewLine & "Genre: " & AlbumGenre
RichTextBox1.Text += vbNewLine & "Year : " & AlbumYear
RichTextBox1.Text += vbNewLine & "Url : " & AlbumLink
' The slow thing I think is here:
RichTextBox1.SelectionStart = RichTextBox1.Text.Length
RichTextBox1.ScrollToCaret
Run Code Online (Sandbox Code Playgroud)
问题是当richtextbox有超过50行时,有更多的行变得更慢以附加新文本(显而易见).
我需要找到一种更好的方法来加速这个过程,当richtextbox行数达到1.000(例如)时,至少放松一个微不足道的速度.
这个问题的原因是因为我想以正确的方式做事情,当我的richtextbox有很多行时,我不喜欢我的应用程序很慢.
请,我需要信息,想法和/或示例(无论是在C#还是VBNET中).谢谢.
我已经创建了一个类来记录鼠标操作,例如用鼠标记录任务(在这里移动鼠标并在那里单击左键然后......).
录制鼠标动作/任务后,我可以使用我制作的主题从类中重现它.
我需要的是实现鼠标的中间按钮和滚动滚动,但我不知道如何做到这一点,我有点难以使用和理解" GetAsyncKeyState ",我找不到信息关于" GetAsyncKeyState中间按钮状态 "或滚轮滚动(向下/向上滚动).
#Region " Record Mouse Class "
' [ Record Mouse Functions ]
'
' // By Elektro H@cker
'
' Examples :
' Record_Mouse.Start_Record()
' Record_Mouse.Stop_Record()
' Record_Mouse.Play() : While Not Record_Mouse.Play_Is_Completed : Application.DoEvents() : End While
' Record_Mouse.Mouse_Speed = 50
Public Class Record_Mouse
''' <summary>
''' Sets the speed of recording/playing the mouse actions.
''' Default value is 25.
''' </summary>
Public Shared Mouse_Speed As Int64 = 25
''' <summary> …Run Code Online (Sandbox Code Playgroud) Intellisense没有显示我的蓝色参数名称,就像我在第三方项目的其他xml评论中看到的那样Intellisense打印了所有信息,这就是我所看到的:

我需要做什么修改才能让intellisense以蓝色打印参数注释作为"返回"?
''' <summary>
''' Function to pause a thread.
''' </summary>
'''
''' <param name="Process_Name">The name of the process, ex: cmd.exe</param>
''' <param name="Thread_Number">The thread to pause, ex: 0</param>
''' <param name="Recursive"> <value name="True">Pause the thread in all processes recursively</value></param>
''' <returns>True if the process is found; otherwise, False.</returns>
Public Shared Function Pause_Thread(ByRef Process_Name As String, _
Optional ByVal Thread_Number As Int32 = 0, _
Optional ByVal Recursive As Boolean = False) As Boolean
Run Code Online (Sandbox Code Playgroud) 我试图在 .NET Framework Classes 中找到最有效且可能实现的方式来监视驱动器,实际上我知道如何执行此 P/调用、使用结构等......但它有很多代码,我想改进它。
所以我发现了这个有趣的类DeviceWatcher,它似乎只能用于 Metro 应用程序?
我找不到有关该类的太多信息,我想知道是否从 Winforms 中引用了所需的 dll,我可以实例化此类以在 Winforms 中使用它吗?
这是因为同样的问题这个其他人,但对于Python的.
问题是我已经构建了我自己的Python解释器安装包(我添加了模块和附加组件),一旦安装,我找不到在PyCharm IDE中设置自定义Python安装目录位置的方法,我可以找不到任何手动指定python解释器位置的选项.
虽然我不知道是否存在我正在考虑的另一种选择,如果PyCharm IDE 可能从注册表值中获取原始Python路径,那么它应该足以设置位置,但我不知道是否pycharm使用配置文件或reg键获取python位置,这个值在哪里修改它,我需要帮助.
PS:我对RubyMine IDE有同样的问题.
在C#或VB.Net 中,我如何使用Microsoft UI 自动化来检索包含文本的任何控件的文本?。
我一直在 MSDN 文档中进行研究,但我不明白。
然后,例如,使用下面的代码,我试图通过提供该窗口的 hwnd 来检索窗口标题栏的文本,但我不知道如何按照标题栏找到子控件(标签?)这确实包含文本。
Imports System.Windows.Automation
Imports System.Windows.Automation.Text
Run Code Online (Sandbox Code Playgroud)
.
Dim hwnd As IntPtr = Process.GetProcessesByName("notepad").First.MainWindowHandle
Dim targetApp As AutomationElement = AutomationElement.FromHandle(hwnd)
' The control type we're looking for; in this case 'TitleBar'
Dim cond1 As New PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.TitleBar)
Dim targetTextElement As AutomationElement =
targetApp.FindFirst(TreeScope.Descendants, cond1)
Debug.WriteLine(targetTextElement Is Nothing)
Run Code Online (Sandbox Code Playgroud)
在上面的示例中,我正在尝试使用标题栏,但只是我想使用任何其他包含文本的控件来执行此操作……例如标题栏。
PS:我知道 P/Invoking GetWindowTextAPI。
我正在测试该ImmutableObjectAttribute属性只是为了好奇,看看我是否可以获得一些应用它的好处,或者它是否仅仅用于语义装饰......
指定对象没有能够编辑的子属性.
所以我有这门课:
<ImmutableObject(True)>
Public Class TestClass
<ImmutableObject(True)>
Public sb As StringBuilder
Public Sub New()
sb = New StringBuilder
End Sub
End Class
Run Code Online (Sandbox Code Playgroud)
我已经使用此代码进行了测试:
Dim obj As New TestClass
obj.sb.Append("Hello")
obj.sb.Append(" ")
obj.sb.Append("World")
MsgBox(obj.sb.ToString)
Run Code Online (Sandbox Code Playgroud)
然后,我会应用后ImmutableObject的可变对象的属性,我希望看到某种编译器警告的,某种运行时异常的,或者只是从的内部串收到意想不到的价值StringBuilder,但没有那事情发生了,一切似乎都正常.
这让我觉得一个问题的答案显而易见,但我需要问一下:
ImmutableObject属性只是一个装饰性的属性?为什么存在这个属性呢?我找不到任何标记具有此属性的类的beneffit它不能确保成员实际上是不可变的,或者至少是.Net理解为不可变的(你知道,就像String在.Net中不是真正不可变的).
.net ×8
vb.net ×8
c# ×5
msbuild ×2
compression ×1
frameworks ×1
immutability ×1
intellisense ×1
mouse ×1
mouseevent ×1
mousewheel ×1
mutable ×1
pycharm ×1
python ×1
python-2.7 ×1
python-3.x ×1
richtextbox ×1
winapi ×1
windows-7 ×1
xml ×1