how to make a dll registrating in registry from a webserver

Discussion in 'ASP .Net' started by Lars Skogshus, Apr 20, 2006.

  1. I made a UserControl in VB.NET and uploaded it to the webserver, my problem
    is that the dll dont register in the registy at the client registry. I
    think it do How should i do?
    here is my code from the website.

    <html>
    <body color=white>
    <hr>
    <font face=arial size=1>
    <object id="myControl1" name="myControl1"
    classid="clsid:50BC5B6D-95F8-4831-A34D-69CB7029C950"
    CODEBASE="http://test.itk.nu/myx.dll" width=288 height=72></object>
    </font>
    <form name="frm" id="frm">
    <input type="text" name="txt" value="enter text here"><input type=button
    value="Click me" onClick="doScript();">
    </form>
    <hr>
    </body>

    <script language="javascript">
    function doScript()
    {
    myControl1.UserText = frm.txt.value;
    }
    </script>
    </html>

    This is the code from VB:

    Imports System.Runtime.InteropServices
    Imports System
    Imports System.Reflection

    <Assembly: AssemblyKeyFileAttribute("myx.snk")>
    <GuidAttribute("50BC5B6D-95F8-4831-A34D-69CB7029C950")> _

    Public Class mycontrol
    Inherits System.Windows.Forms.UserControl
    Private mStr_UserText As String
    Public Property UserText() As String
    Get
    Return mStr_UserText
    End Get
    Set(ByVal Value As String)
    mStr_UserText = Value
    txtUserText.Text = Value
    End Set
    End Property

    #Region " Windows Form Designer generated code "
    Public Sub New()
    MyBase.New()

    InitializeComponent()
    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    If disposing Then
    If Not (components Is Nothing) Then
    components.Dispose()
    End If
    End If
    MyBase.Dispose(disposing)
    End Sub

    Private components As System.ComponentModel.IContainer
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents txtUserText As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.txtUserText = New System.Windows.Forms.TextBox()
    Me.Button1 = New System.Windows.Forms.Button()
    Me.SuspendLayout()
    Me.txtUserText.Location = New System.Drawing.Point(128, 40)
    Me.txtUserText.Name = "txtUserText"
    Me.txtUserText.Size = New System.Drawing.Size(296, 20)
    Me.txtUserText.TabIndex = 0
    Me.txtUserText.Text = "TextBox1"
    Me.Button1.Location = New System.Drawing.Point(48, 40)
    Me.Button1.Name = "Button1"
    Me.Button1.TabIndex = 1
    Me.Button1.Text = "Button1"
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button1,
    Me.txtUserText})
    Me.Name = "mycontrol"
    Me.Size = New System.Drawing.Size(464, 152)
    Me.ResumeLayout(False)
    End Sub
    #End Region


    Private Sub Button1_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Button1.Click
    Dim WSH
    Dim t As String
    WSH = CreateObject("WScript.Shell")
    txtUserText.Text = WSH.RegRead("HKLM\Software\Microsoft\Internet
    Explorer\Version")
    End Sub
    End Class
    Lars Skogshus, Apr 20, 2006
    #1
    1. Advertising

  2. ..net controls hosted by IE run in a sandbox just java applets, and do not
    access to the registery.you will have to change security settings.

    -- bruce (sqlwork.com)


    "Lars Skogshus" <> wrote in message
    news:e282be$3ef$...
    >I made a UserControl in VB.NET and uploaded it to the webserver, my problem
    >is that the dll dont register in the registy at the client registry. I
    >think it do How should i do?
    > here is my code from the website.
    >
    > <html>
    > <body color=white>
    > <hr>
    > <font face=arial size=1>
    > <object id="myControl1" name="myControl1"
    > classid="clsid:50BC5B6D-95F8-4831-A34D-69CB7029C950"
    > CODEBASE="http://test.itk.nu/myx.dll" width=288 height=72></object>
    > </font>
    > <form name="frm" id="frm">
    > <input type="text" name="txt" value="enter text here"><input type=button
    > value="Click me" onClick="doScript();">
    > </form>
    > <hr>
    > </body>
    >
    > <script language="javascript">
    > function doScript()
    > {
    > myControl1.UserText = frm.txt.value;
    > }
    > </script>
    > </html>
    >
    > This is the code from VB:
    >
    > Imports System.Runtime.InteropServices
    > Imports System
    > Imports System.Reflection
    >
    > <Assembly: AssemblyKeyFileAttribute("myx.snk")>
    > <GuidAttribute("50BC5B6D-95F8-4831-A34D-69CB7029C950")> _
    >
    > Public Class mycontrol
    > Inherits System.Windows.Forms.UserControl
    > Private mStr_UserText As String
    > Public Property UserText() As String
    > Get
    > Return mStr_UserText
    > End Get
    > Set(ByVal Value As String)
    > mStr_UserText = Value
    > txtUserText.Text = Value
    > End Set
    > End Property
    >
    > #Region " Windows Form Designer generated code "
    > Public Sub New()
    > MyBase.New()
    >
    > InitializeComponent()
    > End Sub
    >
    > Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    > If disposing Then
    > If Not (components Is Nothing) Then
    > components.Dispose()
    > End If
    > End If
    > MyBase.Dispose(disposing)
    > End Sub
    >
    > Private components As System.ComponentModel.IContainer
    > Friend WithEvents Button1 As System.Windows.Forms.Button
    > Friend WithEvents txtUserText As System.Windows.Forms.TextBox
    > <System.Diagnostics.DebuggerStepThrough()> Private Sub
    > InitializeComponent()
    > Me.txtUserText = New System.Windows.Forms.TextBox()
    > Me.Button1 = New System.Windows.Forms.Button()
    > Me.SuspendLayout()
    > Me.txtUserText.Location = New System.Drawing.Point(128, 40)
    > Me.txtUserText.Name = "txtUserText"
    > Me.txtUserText.Size = New System.Drawing.Size(296, 20)
    > Me.txtUserText.TabIndex = 0
    > Me.txtUserText.Text = "TextBox1"
    > Me.Button1.Location = New System.Drawing.Point(48, 40)
    > Me.Button1.Name = "Button1"
    > Me.Button1.TabIndex = 1
    > Me.Button1.Text = "Button1"
    > Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button1,
    > Me.txtUserText})
    > Me.Name = "mycontrol"
    > Me.Size = New System.Drawing.Size(464, 152)
    > Me.ResumeLayout(False)
    > End Sub
    > #End Region
    >
    >
    > Private Sub Button1_Click(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Button1.Click
    > Dim WSH
    > Dim t As String
    > WSH = CreateObject("WScript.Shell")
    > txtUserText.Text = WSH.RegRead("HKLM\Software\Microsoft\Internet
    > Explorer\Version")
    > End Sub
    > End Class
    >
    >
    >
    >
    bruce barker \(sqlwork.com\), Apr 20, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HK
    Replies:
    1
    Views:
    3,629
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  2. boy0612
    Replies:
    1
    Views:
    386
    Bryant Hankins
    Aug 19, 2004
  3. Replies:
    0
    Views:
    748
  4. Leny
    Replies:
    3
    Views:
    16,921
    Daniel
    Feb 1, 2005
  5. boy0612

    create asp webserver without registry

    boy0612, Aug 19, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    102
    boy0612
    Aug 19, 2004
Loading...

Share This Page