I won't say much nonsense, just go to the topic
Create a Windows project using VS2005 and name it test
Reference dll file
Write code and reference the class library in the dll normally.
At the same time, add resource files to the test project (this file is the dll file referenced just now)
VS2005 will automatically generate reference code, what I quote here is
internal static byte[] IrisSkin2 {
get {
object obj = ("IrisSkin2", resourceCulture);
return ((byte[])(obj));
}
}
Then add the code in the Main() function
static void Main()
{
();
(false);
string path = + "\";
string dllFileName = "";
//******load******
if (!(path + dllFileName)) //The file does not exist
{
FileStream fs = new FileStream(path + dllFileName, , );
byte[] buffer = .IrisSkin2;//{GetData is the namespace}
(buffer, 0, );
();
}
//*****************************
(new GDForm());
}
Compile the test project, generate the exe file, and then delete the referenced dll file (note that it is compiled first, then deleted)
Copy the exe file and run it elsewhere (no dll is needed, running EXE will automatically generate DLL files)
Create a Windows project using VS2005 and name it test
Reference dll file
Write code and reference the class library in the dll normally.
At the same time, add resource files to the test project (this file is the dll file referenced just now)
VS2005 will automatically generate reference code, what I quote here is
Copy the codeThe code is as follows:
internal static byte[] IrisSkin2 {
get {
object obj = ("IrisSkin2", resourceCulture);
return ((byte[])(obj));
}
}
Then add the code in the Main() function
Copy the codeThe code is as follows:
static void Main()
{
();
(false);
string path = + "\";
string dllFileName = "";
//******load******
if (!(path + dllFileName)) //The file does not exist
{
FileStream fs = new FileStream(path + dllFileName, , );
byte[] buffer = .IrisSkin2;//{GetData is the namespace}
(buffer, 0, );
();
}
//*****************************
(new GDForm());
}
Compile the test project, generate the exe file, and then delete the referenced dll file (note that it is compiled first, then deleted)
Copy the exe file and run it elsewhere (no dll is needed, running EXE will automatically generate DLL files)