Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 594635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:58:30+00:00 2026-05-13T15:58:30+00:00

Now I’m solving web server performance testing task and a have a little problem.

  • 0

Now I’m solving web server performance testing task and a have a little problem.

There is a way to communication between DHTML and C# code. It works perfectly in Win Application but I need Console Application.
So I create simple test

Program.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CometTest
{    
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Client c = new Client(@"URL");
            Console.ReadLine();
            Console.WriteLine(c.ToString());

        }

    }
}
    

Client.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Permissions;

namespace CometTest
{
    [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
    [System.Runtime.InteropServices.ComVisibleAttribute(true)]
    public class Client
    {
        public WebBrowser browser;

        public Client(string host)
        {
            browser = new WebBrowser();
            browser.ObjectForScripting = this;
            browser.Navigate(host);      
        }
        public void Notify(String message)
        {
            Console.WriteLine(message);
        }
    }
}
    

In my JavaScript code I perform
window.external.Notify(‘test’);
, but without success 🙁

Any Suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:58:30+00:00Added an answer on May 13, 2026 at 3:58 pm

    I think you pretty much have the same proplem as the guy here: WebBrowser Control – Console Application – Events Not Firing

    Maybe the answer he got helps you, too. The messages from an console application are not fired because:

    The basic requirement of an STA thread is that it needs to run a message pump. In Windows Forms, you can use Application.Run. Or you could write the message pump by hand, using user32!GetMessage & DispatchMessage. But it’s probably easier to use the one in WinForms or WPF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now I have another problem with WCF server/client. I have a method: bool spr_wiersz(int
Now I'll little explain my purpose: I have the following selection SELECT id, way_id,
now i have such structure on my server ./site.com/ ./site.com/mage ./site.com/mage/Mage.php ./site.com/mage/app ......... ./site.com/public
Now I have learnt a little bit of assembler (using NASM) I want to
Now i know there have been a lot of question about this, but i
now I have this configuration my my scheduler: <task:scheduled ref=task method=run cron=0 45 22
Now that .NET 4.5 and Visual Studio 2012 has RTM, is there a way
Now i'm using jQuery library and i faced the folowing problem: Supppose i have
Now facebook require to have these options when you want to use bulit-in actions
Now I am creating an address book in Java 1.6. Now how I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.