Access to Application object from exe

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Access to Application object from exe

    Hi,

    I have many virtual directory with my web app. I'd like to create one exe
    appliaction to administrating these web apps. Is it possible to access
    Application object of web appliaction from exe appliaction?

    With regards,

    Woland


    Woland Guest

  2. Similar Questions and Discussions

    1. Application Object
      How easy is it for a hacker to access data stored in the Application Object in IIS server. I want to store a decrpyted connection string there rather...
    2. HELP! "Access is denied to this object." - Server object error 'ASP 0178 : 80070005'
      Hi, When I try to do Server.CreateObject on an activeX DLL, I receive the following message: ''''''''''''''''''''''' Server object error 'ASP...
    3. What issue will HIT me hard when I convert an Access 2002 MDE application to Web Application?
      Hi All, Current Access 2002 MDE application: - has no tier - has neither business object nor any kind of object (Except MS Form object and...
    4. Access denied when creating Access application object
      In an ASP file I am running the following in VBScript in order to extract data from an Access 2002 MDB file which is physically located in the...
    5. How to access the application-object to lock it from session?
      Hi, You try to access non static member from static function. Use HttpContext.Current.Application.Lock (); to solve your situation. Natty...
  3. #2

    Default Re: Access to Application object from exe

    As far as I know you cant. If you want i got an example that let you
    access all AppDomaines (Applications) from ASP.NET page.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  4. #3

    Default Re: Access to Application object from exe


    "Natty Gur" <natty@dao2com.com> wrote in message
    news:e1FYAxxPDHA.3016@TK2MSFTNGP10.phx.gbl...
    > As far as I know you cant. If you want i got an example that let you
    > access all AppDomaines (Applications) from ASP.NET page.
    >
    > Natty Gur, CTO
    I'd be very grateful if you send me this app or link to the page where I can
    look at it.

    Thanks in advance,

    Woland
    Woland1(at)poczta.onet.pl


    Woland Guest

  5. #4

    Default Re: Access to Application object from exe

    1)You need to reference mscoree tlb.
    2)the code :

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Reflection;
    using System.Runtime.InteropServices;

    namespace WebApplication3
    {
    /// <summary>
    /// Summary description for WebForm1.
    /// </summary>
    public class WebForm1 : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.Button btnStop;
    protected System.Web.UI.WebControls.CheckBoxList CheckBoxList1;

    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the page here
    if (!this.IsPostBack)

    GetAllDomains();
    }

    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
    this.CheckBoxList1.SelectedIndexChanged += new
    System.EventHandler(this.CheckBoxList1_SelectedInd exChanged);
    this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
    this.Load += new System.EventHandler(this.Page_Load);

    }
    #endregion

    private void btnStop_Click(object sender, System.EventArgs e)
    {
    System.AppDomain.Unload (System.AppDomain.CurrentDomain );

    mscoree.CorRuntimeHostClass host = new mscoree.CorRuntimeHostClass();
    IntPtr enumHandle = IntPtr.Zero;
    host.EnumDomains( out enumHandle );
    object dom = null;
    while(true)
    {
    host.NextDomain( enumHandle, out dom );
    if( dom == null )
    break;
    AppDomain ad = (AppDomain) dom;
    //dom = null;
    for(int iIndx =0;iIndx < CheckBoxList1.Items.Count;iIndx++)
    {
    if ( CheckBoxList1.Items[iIndx].Value == ad.FriendlyName )
    {
    if ( CheckBoxList1.Items[iIndx].Selected == true )
    {
    System.Security.Policy.Evidence NE = new
    System.Security.Policy.Evidence(ad.Evidence);
    System.AppDomainSetup NADS = new System.AppDomainSetup();
    NADS.ApplicationBase = ad.SetupInformation.ApplicationBase;
    NADS.ApplicationName = ad.SetupInformation.ApplicationName;
    NADS.ConfigurationFile = ad.SetupInformation.ConfigurationFile;
    NADS.DynamicBase = ad.SetupInformation.DynamicBase;
    NADS.PrivateBinPath = ad.SetupInformation.PrivateBinPath;
    ad.ClearPrivatePath();
    ad.ClearShadowCopyPath();
    host.UnloadDomain( ad);
    //host.DeleteLogicalThreadState ();
    System.AppDomain.Unload (System.AppDomain.CurrentDomain );

    //System.AppDomain.Unload(ad);
    System.Web.Hosting.ApplicationHost.CreateApplicati onHost(System.T
    ype.GetType("mscoree.CorRuntimeHostClass"),"CRExam ple","c:\\Inetpub\\www
    root\\CRExample");
    //System.AppDomain.CreateDomain(CheckBoxList1.Items[iIndx].Value
    ,NE,NADS ) ;
    }
    break;
    }
    }
    dom = null;
    ad = null;
    }
    host.CloseEnum( enumHandle );
    int refctr = Marshal.ReleaseComObject( host );
    host = null;

    GetAllDomains();
    }
    private void GetAllDomains()
    {
    this.CheckBoxList1.Items.Clear ();

    mscoree.CorRuntimeHostClass host = new mscoree.CorRuntimeHostClass();

    IntPtr enumHandle = IntPtr.Zero;
    host.EnumDomains( out enumHandle );
    object dom = null;
    while(true)
    {
    host.NextDomain( enumHandle, out dom );
    if( dom == null )
    break;
    AppDomain ad = (AppDomain) dom;
    dom = null;
    ListItem oLI = new ListItem(ad.FriendlyName,ad.FriendlyName);
    CheckBoxList1.Items.Add ( oLI);
    //Response.Write ( ad.FriendlyName + "<br>");

    //try
    //{
    // Assembly[] allAsm = ad.GetAssemblies();
    //
    // foreach( Assembly asm in allAsm )
    // Response.Write( " -->" + asm.FullName + "<br>" );
    //}
    //catch (Exception err)
    //{
    // Response.Write(err.Message + "<br>" );
    //}
    //
    ad = null;
    }
    host.CloseEnum( enumHandle );
    int refctr = Marshal.ReleaseComObject( host );
    host = null;

    }

    private void CheckBoxList1_SelectedIndexChanged(object sender,
    System.EventArgs e)
    {

    }
    }
    }


    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  6. #5

    Default Re: Access to Application object from exe

    "Natty Gur" <natty@dao2com.com> wrote in message
    news:uTPrktEQDHA.2424@tk2msftngp13.phx.gbl...
    > 1)You need to reference mscoree tlb.
    > 2)the code :
    [...]
    > Natty Gur, CTO
    Thanks very much Natty.

    Woland


    Woland Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139