I. NET and winformCodeGet webconfig content
Webconfig:
<Deleetask>
<Add key ="Strconn"Value ="Server = 10.1.0.7; database = dB; uid = sa; Password ="/>
</Appsettings>
Get in code:
UsingSystem. configuration;
Private Static StringConnectionstring = configurationsettings. etettings ["Strconn"]. Tostring ();
However, the configurationsettings mentioned above are outdated and need to be replaced by configurationmanager. However, the configurationmanager's
Only referencesSystem. configuration. dllCan be found
Private Static StringConnectionstring = system. configuration. configurationmanager. etettings ["Strconn"]. Tostring ();
Net can be obtained, and winform seems to be unable to be obtained. XML can be obtained.Portal
2. "NoSource code"
I encountered an error in modifying others' source code.
Cause: because the old DLL is called, and your path and the location of the original project are not
Solution: you only need to clear the small project and module with the error and generate a new one.
Details:
Right-click solution> Properties> Common Properties> debug source file,
Look at yourProgramHas it been added to the "do not find these source files" box.
Then you can see if your path does not exist. Find the Project block of the source file: Clean Up + generate
Iii. Usage of Base
Public Temp2 ( Int Fo ): Base () // Call the constructors without parameters of the parent class.
{
Console. writeline ( " Child class no paramer " );
}
Public Temp2 ( Int Fo ): Base (FO) // Call the constructor with parameters of the parent class.
{
Console. writeline ( " Child class " );
}
Public Override Void Showinfo () // Reload the showinfo method of the parent class
{
Base . Showinfo (); // Call the showinfo method of the parent class
Console. writeline ( " This child's Method " );
}