I have been busy with some things recently and haven't published any articles.
In the past few days, I 've been reading something about vs plug-in development. I wrote a small program with no technical content, but it's a bit interesting. Haha.
When vs is enabled, a prompt box similar to logon will pop up, prompting you to enter the account and password:
If the input is incorrect, a prompt is displayed and you can exit vs directly:
If the input is correct, the system prompts the welcome message to go to:
Because the code of this function is mixed with other projects, I will not issue the complete code. Let's talk about the design steps, which is very simple.
The procedure is as follows:
Open vs, create a project, and find "vs package" in "other project types" on the left ".
If not, download the SDK of the corresponding version of Visual Studio and install it, that is, more than one hundred MB. Self-Test vs2012 comes with it. vs2013 needs to be downloaded separately.
This project is the production project of the visx plug-in of vs. After writing it, you can generate a visx plug-in and double-click it to install it to the project in.
Then, after creating a new project, find the "Project name package. cs" file in the project. This file is the file for the plug-in to start and run each time, which is equivalent to the Startup File.
Therefore, open this file and there will be a constructor, where you can write the login code or load.
Create a login interface form. Here I create a WPF form and drag and drop the desired interface, for example, my:
Then you don't need to write the logon code.
Finally, return to the "Project name package. cs" Startup File and add the code for starting the logon interface in the constructor or load method.
Here, I wrote in load:
Protected override void initialize () {base. initialize (); // In the initialization method, add the Method Application for the current program load event. current. mainwindow. loaded + = mainwindow_loaded;} // method of the load event void mainwindow_loaded (Object sender, routedeventargs e) {// instantiate and open the login interface startup form login = new startup form (); login. showdialog ();}
After a project is generated, a "project name. visx" plug-in will be generated in the project bin \ Debug. Close the vs plug-in, double-click the plug-in to install it, and then re-open the Vs. Let's see the effect.
The plug-in is automatically installed in "tools-extensions and updates.
If an error occurs, it indicates that vsis disabled. Run the command "restart devenv.exe/safemode" to open vs security mode, and go to "tools-extensions and updates" to uninstall the plug-in you just created.
If you still don't understand anything, leave a message.
Although I haven't sent much code, it's not easy to type it, just give it a thumbs up.
[From: [lonelyshadow blog] http://www.cnblogs.com/lonelyshadow]
Vs plug-in development-logon authentication