我有 InnoSetup 做的这个自动脚本:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId=
AppName=VideoScreenRecorder
AppVersion=1.5
;AppVerName=VideoScreenRecorder 1.5
AppPublisher=Daniel Lipman
DefaultDirName={pf}\VideoScreenRecorder
DefaultGroupName=VideoScreenRecorder
InfoBeforeFile=D:\ScreenVideoRecorderHelp.txt
OutputDir=D:\ScreenVideoRecorderCompiler
OutputBaseFilename=Setup
SetupIconFile=D:\Activity Monitor.ico
Compression=lzma
SolidCompression=yes
[Languages]
Name: …Run Code Online (Sandbox Code Playgroud) 这是代码:
public OptionsFile(string settings)
{
if (File.Exists(settings))
{
}
else
{
FileStream fs=File.Create(settings);
fs.Close();
}
path_exe = Path.GetDirectoryName(Application.LocalUserAppDataPath);
Options_File = settings;
}
Run Code Online (Sandbox Code Playgroud)
上线:FileStream fs=File.Create(settings);
由于某种原因,它无法创建该文件。在 Form1 中我在构造函数中做了:
Options_DB.Get_Video_File();
Run Code Online (Sandbox Code Playgroud)
现在在 Options_DB 类中使用断点执行以下操作:
namespace test
{
static class Options_DB
{
static string settings_dir;
static string settings_file;
static OptionsFile setting_file;
static string path_settings;
static string path_exe;
static string outPutVideoFileDirectory;
static Options_DB()
{
// --- O P E N N I N G S E T T I N G F I L E …Run Code Online (Sandbox Code Playgroud) 这是我的代码:
this.Invoke(new MethodInvoker(delegate {
label13.Text = e.failedUrls + doneWebPages.ToString();
}));
Run Code Online (Sandbox Code Playgroud)
结果是:01,02,03,04 ..... 09,111
当e.failedUrls现在是例如1并且doneWebPages是22时所以在label13中显示我,总和23我看到122.
怎么了 ?