小编Moh*_*air的帖子

如何使用发送键将Ctrl + Shift + F1发送到应用程序

我想将Ctrl+ Shift+ F1组合键发送到应用程序.

但是,当我尝试发送密钥时,我收到错误,错误是,^+F1不是有效密钥.

我使用的代码是:

System.Windows.Forms.SendKeys.Send("{^+F1}");
Run Code Online (Sandbox Code Playgroud)

c# sendkeys winforms

10
推荐指数
1
解决办法
2万
查看次数

GZip标头中的幻数不正确.确保传入GZip流.(.exe文件)

我想提取一个exe文件.exe文件包含一些文件和文件夹.当我尝试使用winrar提取文件时,它会被提取,但是当我尝试使用一些示例提取exe文件时,我收到此错误:

GZip标头中的幻数不正确.确保传入GZip流.

我已经使用了一些样本并搜索了很多我的问题,但没有得到我的答案,我也使用了一些库.

我使用此代码但错误相同:

    public static void Decompress(FileInfo fi)
    {
        // Get the stream of the source file.
        using (FileStream inFile = fi.OpenRead())
        {
            // Get original file extension, for example
            // "doc" from report.doc.gz.
            string curFile = fi.FullName;
            string origName = curFile.Remove(curFile.Length -
                    fi.Extension.Length);

            //Create the decompressed file.
            using (FileStream outFile = File.Create(origName))
            {
                using (GZipStream Decompress = new GZipStream(inFile,
                        CompressionMode.Decompress))
                {
                    // Copy the decompression stream 
                    // into the output file.
                    Decompress.CopyTo(outFile);

                    Console.WriteLine("Decompressed: {0}", fi.Name);

                }
            }
        } …
Run Code Online (Sandbox Code Playgroud)

c# compression unzip self-extracting winforms

7
推荐指数
1
解决办法
7571
查看次数

标签 统计

c# ×2

winforms ×2

compression ×1

self-extracting ×1

sendkeys ×1

unzip ×1