DLL registration in C #

Source: Internet
Author: User
My POS client in C # Program Call someone else's api_com.dll program, and then I use a third-party tool to automatically update the client. Now there is a problem. Every time there is a new version, the automatic update program always copies the original directory to the new directory. As a result, api_com.dll in the new directory is not registered and the program cannot run. Could you tell me, is there any way for api_com.dll to be registered only once (during installation) or globally. Or, in C #, how to write Code To realize the DLL registration function ??????????? Execommand ("regsvr32 path \ ***. dll ") Public String Execommand (string commandtext) {PROCESS p = new process (); p. startinfo. filename = "cmd.exe"; p. startinfo. useshellexecute = false; p. startinfo. redirectstandardinput = true; p. startinfo. redirectstandardoutput = true; p. startinfo. redirectstandarderror = true; p. startinfo. createnowindow = true; string stroutput = NULL; try {P. start (); p. standardinput. writeline ( Commandtext ); P. standardinput. writeline ("exit"); stroutput = P. standardoutput. readtoend (); p. waitforexit (); p. close ();} catch (exception e) {stroutput = E. message;} return stroutput ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.