Skip to content

Commit 756eded

Browse files
committed
DLL open file dialog implemented
1 parent b1ad4a0 commit 756eded

7 files changed

+40
-13
lines changed

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# CS8618: Un champ non-nullable doit contenir une valeur non-null lors de la fermeture du constructeur. Envisagez de déclarer le champ comme nullable.
4+
dotnet_diagnostic.CS8618.severity = silent

DLLoad.sln

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.4.33213.308
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DLLoad", "DLLoad\DLLoad.csproj", "{9647D135-DF48-4A60-AB4D-6E0E11CF6558}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DLLoad", "DLLoad\DLLoad.csproj", "{9647D135-DF48-4A60-AB4D-6E0E11CF6558}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D7BA431C-33D8-4863-B71F-DCD65F425D9D}"
9+
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
11+
EndProjectSection
712
EndProject
813
Global
914
GlobalSection(SolutionConfigurationPlatforms) = preSolution

DLLoad/DLLoad.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@
88
<ImplicitUsings>enable</ImplicitUsings>
99
</PropertyGroup>
1010

11+
<ItemGroup>
12+
<None Include="..\.editorconfig" Link=".editorconfig" />
13+
</ItemGroup>
14+
1115
</Project>

DLLoad/Form1.Designer.cs

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DLLoad/Form1.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System.Diagnostics;
2-
using System.Security.Cryptography.X509Certificates;
32

43
namespace DLLoad
54
{
65
public partial class MainForm : Form
76
{
87
private Process selectedProcess;
8+
private Stream selectedDll;
99

1010
public MainForm()
1111
{
@@ -31,5 +31,16 @@ private void btnBrowseProcesses_Click(object sender, EventArgs e)
3131
tbProcessName.Text = selectedProcess.ProcessName;
3232
tbProcessID.Text = selectedProcess.Id.ToString();
3333
}
34+
35+
private void btnBrowseDll_Click(object sender, EventArgs e)
36+
{
37+
var dialogResult = openDllFileDialog.ShowDialog();
38+
if (dialogResult == DialogResult.OK)
39+
selectedDll = openDllFileDialog.OpenFile();
40+
else
41+
return;
42+
43+
tbDllPath.Text = openDllFileDialog.FileName;
44+
}
3445
}
3546
}

DLLoad/Form1.resx

+3
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@
6060
<metadata name="ilIcons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
6161
<value>17, 17</value>
6262
</metadata>
63+
<metadata name="openDllFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
64+
<value>130, 17</value>
65+
</metadata>
6366
</root>

DLLoad/SelectProcess.cs

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel;
4-
using System.Data;
5-
using System.Diagnostics;
6-
using System.Drawing;
7-
using System.Linq;
8-
using System.Text;
9-
using System.Threading.Tasks;
10-
using System.Windows.Forms;
1+
using System.Diagnostics;
112

123
namespace DLLoad
134
{
145
public partial class SelectProcess : Form
156
{
16-
public Process selectedProcess { get; set; }
7+
public Process selectedProcess;
178

189
public SelectProcess()
1910
{

0 commit comments

Comments
 (0)