IT Community - Software Programming, Web Development and Technical Support

Register dll or ocx using through code in C#

This is a discussion on Register dll or ocx using through code in C# within the C# Programming forums, part of the Software Development category; Hi, I want to register dll or ocx through code in C#. I have tried to register this using the ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-21-2008, 08:53 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Register dll or ocx using through code in C#

Hi,

I want to register dll or ocx through code in C#. I have tried to register this using the setup file in C#. But, I am unable to do this. Is there any possibilities to register this through code
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-21-2008, 08:59 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 181
Balasubramanian.S is on a distinguished road
Default Re: Register dll or ocx using through code in C#

Hi,

Using the following function you can register dll or ocx files.

public void Register(string[] assemblyNames)
{
for (int i = 0; i < assemblyNames.Length; i++)
{
Process proc = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo("Regsvr32.exe"," /s "+ assemblyNames[i]);
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
proc.StartInfo = startInfo;
proc.Start();
while (!proc.HasExited)
{
}
proc.Close();
}

}
__________________
S.Balasubramanian
Nothing is impossible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-21-2008, 09:04 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: Register dll or ocx using through code in C#

Hi,

Thanks for your help.
I Have to register dll only once. But this function register dll every time when application opened. So, how can we block this function be called only once.
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-21-2008, 09:07 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 181
Balasubramanian.S is on a distinguished road
Default Re: Register dll or ocx using through code in C#

Hi,

You can use xml to register dll only once. Just set a flag in xml. if the dll registered, change the flag status. So, every time application executed, Read the flag in xml and decide whether the function is to be called or not.
__________________
S.Balasubramanian
Nothing is impossible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-05-2008, 11:58 PM
sahara10 sahara10 is offline
D-Web Trainee
 
Join Date: Aug 2008
Posts: 3
sahara10 is on a distinguished road
Default Re: Register dll orbest

So I created the form, pasted the HTML on my site, and now when I submit my info, it says

"This form is not being sent from the url where it is supposed to be located. If you are the owner of this form you need to ensure that the 'Form Location' is specified as (TRUE FORM LINK). To change this, login to the site, click 'edit' next to the form's name, and then click the 'Basic Information' link to change the form's location.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Secure PHP code vadivelanvaidyanathan PHP Programming 3 10-05-2008 11:17 PM
Zip code,Proximity kingmaker Database Support 3 10-11-2007 07:23 AM
I want the explanation for the below example code.. oxygen PHP Programming 1 07-26-2007 02:39 AM
How to create a simple dll using VC++ and how to register it windows XP? oxygen C and C++ Programming 1 07-24-2007 04:25 AM
optimizing the code vijayanand PHP Programming 0 07-16-2007 11:25 PM


All times are GMT -7. The time now is 09:03 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0