小编use*_*697的帖子

在nginx中编码和解码路径名

通常可以在以下位置访问文件:

http://example.com/cats/cat1.zip

我想编码/加密路径名(/cats/cat1.zip),以便链接通常不可访问,但在路径名加密/编码后可访问:

http://example.com/Y2F0cy9jYXQxLnppcAo=

我上面使用base64编码是为了简单,但更喜欢加密.我该怎么做呢?我是否必须编写自定义模块?

encryption configuration nginx

8
推荐指数
4
解决办法
3262
查看次数

UpdateResource不能将lpType用作字符串

P/Invoke声明:

[DllImport("kernel32.dll")]
static extern bool UpdateResource(IntPtr hUpdate, IntPtr lpType, IntPtr lpName, ushort wLanguage, byte[] lpData, uint cbData);
[DllImport("kernel32.dll")]
static extern bool UpdateResource(IntPtr hUpdate, string lpType, int lpName, ushort wLanguage, byte[] lpData, uint cbData);
[DllImport("kernel32.dll")]
static extern IntPtr BeginUpdateResource(string pFileName, bool bDeleteExistingResources);
[DllImport("kernel32.dll")]
static extern bool EndUpdateResource(IntPtr hUpdate, bool fDiscard);
Run Code Online (Sandbox Code Playgroud)

我的代码:

var hUpdate = BeginUpdateResource(FilePath, false);
var BMP = File.ReadAllBytes(BmpPath);
UpdateResource(hUpdate, "2", 123, 1033, BMP, (uint)BMP.Length);
UpdateResource(hUpdate, "#2", 123, 1033, BMP, (uint)BMP.Length);
UpdateResource(hUpdate, "RT_BITMAP", 123, 1033, BMP, (uint)BMP.Length);
UpdateResource(hUpdate, "BITMAP", 123, …
Run Code Online (Sandbox Code Playgroud)

.net c# vb.net winapi

5
推荐指数
1
解决办法
461
查看次数

在C#中为0x80000000 == 2147483648但在VB.NET中没有

在C#中:

0x80000000==2147483648 //outputs True
Run Code Online (Sandbox Code Playgroud)

在VB.NET中:

&H80000000=2147483648 'outputs False
Run Code Online (Sandbox Code Playgroud)

这怎么可能?

.net c# vb.net hex

5
推荐指数
2
解决办法
1593
查看次数

ListBox/ListView 等控件的默认 ItemTemplate

我在哪里可以找到/ItemTemplate等控件的默认值?MSDN 中没有关于此的任何内容。ListBoxListView

<ListBox.ItemTemplate>
    <DataTemplate>
        <!--What's the default value of this?-->
    </DataTemplate>
</ListBox.ItemTemplate>
Run Code Online (Sandbox Code Playgroud)

.net wpf xaml

4
推荐指数
1
解决办法
660
查看次数

标签 统计

.net ×3

c# ×2

vb.net ×2

configuration ×1

encryption ×1

hex ×1

nginx ×1

winapi ×1

wpf ×1

xaml ×1