小编Zi *_*ing的帖子

更改从Visual Studio 2010生成的exe文件的图标

我目前正在Visual Studio 2010中创建一个应用程序.在构建项目以生成应用程序的输出后,我发现.exe是使用默认图标构建的.

有没有办法更改或使用我自己的图片作为Visual Studio 2010生成的.exe文件的图标?

visual-studio-2010

30
推荐指数
1
解决办法
9万
查看次数

拖放listview C#

我目前正试图让我的程序能够拖动文件并将其放入列表视图中.我看到很多样本,其中大部分都有以下代码:

private void listView1_draganddrop(object sender,  DragEventArgs e)
Run Code Online (Sandbox Code Playgroud)

然而,在我实现了这些代码后,我遇到了一些错误.首先是listview1_SelectedIndexChanged匹配委托系统事件处理程序没有重载

另一个问题是在代码被暗示后我无法将任何文件拖入listview.

我在listview上启用了允许删除功能.所以我想知道在c#中启用拖放功能我缺少什么以及如何编写拖放代码.

c# directory listview drag-and-drop file

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

如何从列表框C#中删除所选项目

我目前正在尝试查看用户在列表框中选择的所有文件和文件夹.在片刻我能够列出用户使用openfiledialogue选择的内容,但是当我尝试从列表框中删除它时,我现在面临的问题.我试图让用户点击文件旁边的复选框,然后按下删除按钮将其删除

这是我删除按钮的代码

      private void button2_Click(object sender, EventArgs e)
    {
        for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--)
        {
            listView1.Items.Remove(listView1.SelectedItems[i]);
        }

    }
Run Code Online (Sandbox Code Playgroud)

这是列表框的添加文件,以供参考jsut使用

    private void button1_Click(object sender, EventArgs e)
    {

        OpenFileDialog openfiledialog = new OpenFileDialog();
        // Display open file dialog
        openfiledialog.InitialDirectory = "C:\\";
        //openfiledialog.Multiselect = true;
        openfiledialog.Title = "Lock File";
        openfiledialog.Filter = "All Files | *.*";
        openfiledialog.ShowDialog();


        if (openfiledialog.FileName != "")
        {

        //move through FileInfo array and store in new array of fi
            listView1.Items.Clear();
            foreach (string file in …
Run Code Online (Sandbox Code Playgroud)

c# listbox winforms

0
推荐指数
2
解决办法
4万
查看次数

拖放listview C#

您好,当我双击列表视图时,如何启用拖动事件处理程序?

这是双击列表视图后得到的结果

private void listView1(object sender, EventArgs e)
Run Code Online (Sandbox Code Playgroud)

但是,我希望它是

private void listView(object sender,DragEventArgs e)
Run Code Online (Sandbox Code Playgroud)

我该怎么做..?

我尝试了很多方法,例如:

  private void Form_Load(object sender, EventArgs e)
  {
      // Enable drag and drop for this form
      // (this can also be applied to any controls)
      this.AllowDrop = true;

      // Add event handlers for the drag & drop functionality
      this.DragEnter += new DragEventHandler(Form_DragEnter);
      this.DragDrop += new DragEventHandler(Form_DragDrop);
 }
Run Code Online (Sandbox Code Playgroud)

c# directory drag-and-drop file winforms

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

如何使用java将字节数组附加到文件而不覆盖它

我尝试进行 AES 加密,并且正在生成盐。但是我遇到了一些问题。下面的代码工作正常,但每当我加密第二个等文件时,文件中的盐就会被覆盖。关于如何将 salt 字节 [] 附加到 salt fil 中而不覆盖它有什么建议吗?

\n\n

伙计们..我更新了我的代码..感谢那部分,虽然它解决了覆盖问题,但它没有进入下一行。

\n\n

我的文件上的输出: \xcb\x9cV"\xc3\x83\xc2\xb7\xc3\x92\xc2\xb2\xc3\x964\xc3\xb4\xc2\xa6\xc5\x92T\xe2\x80\xb0m\xc3 \x8a\xc3\xae0\xe2\x80\x98Z^\'\xc3\xbb\xe2\x80\xa2\xc5\xa1\xc3\x99K\xc2\xb7 = 这是两个盐的组合。

\n\n

知道如何将其附加到下一行吗?

\n\n

我尝试 saltoutfile.write("/n") 但不起作用

\n\n
    public byte[] generateSalt() throws IOException{\n            //generate Salt value\n            // password, iv and salt should be transferred to the other end\n            // in a secure manner\n            // salt is used for encoding\n            // writing it to a file\n            // salt should be transferred to the recipient securely\n            // for decryption\n    byte[] salt = new byte[8];\n    SecureRandom …
Run Code Online (Sandbox Code Playgroud)

java arrays encryption file append

0
推荐指数
1
解决办法
3179
查看次数