Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Saturday, March 31, 2012

Sendkeys not declared?


I just downloaded ASP.Net Web Matrix and I'm really enjoying using it, even though I only know what I am doing about 10% of the time. The one problem I've encountered is that I can't get a VB "SendKeys" statement to work in an ASPX page. I have a really simple script written. Here it is:
Sub Button1_Click(sender As Object, e As EventArgs)
Shell ("notepad", 1)
SendKeys ("%", True)
End Sub
The button code is:
<form id="form1" runat="server">
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>
</form>
When I run the page, it returns an error that states: "SendKeys statement not declared." Originally, I had no parentheses around "%, True," but ASP.NET demanded it so I put it in. Any help would be greatly appreciated. I am SendKeys-dependent.

Hi,

In .NET SendKey is a class declared in System.Windows.Forms namespace. You can use it as follows:

SendKeys.SendWait("%")

But... It is really not a good idea to open notepad at server from ASP.NET application. Is this what you intend to do?


Thank you so very much for your response. I am continuing to get the same error message, even after adaptation of the command to Sendkeys.Sendwait:

"Compiler Error Message:
BC30451: Name 'SendKeys' is not declared."

I had previously located Sendkeys as an identified namespace within System.Windows.Forms, but I am not sure what to do with that information beyond that. Is there something I need to do to get the page to "talk" with that class or namespace?

As for your caution, I appreciate it. Have read the warnings. The application is going to run only on my PC. Does that minimize the concern?
Again, thank you for your time.


Hi,
You have to reference System.Windows.Forms.dll to use this method.
I think what you want to do is to open notepad from client script and not from server side code. You can use scripting host to do it. In vbscript it will look like this:
Dim WshSHell
set WshShell = CreateObject("WScript.Shell")
WshShell.Run("notepad")
WScript.Sleep(100)
WshShell.AppActivate("Notepad")
WScript.Sleep(100)
WshShell.SendKeys("abc")

Monday, March 26, 2012

Sequential one request at a time processing

ASP.NET processes one request at a time, sequentially. If one process
blocks or sleeps then it brings down the entire application for all
users.

This fact is hidden under the rug by Microsoft. It would clearly be a
problem for any website that has tons of traffic.

On this I seek specifics.

Is it sequential per DLL or per page? If one page blocks, on say a big
database query, will other pages process and respond?

On a multi-processor server, say with four processors, is this still a
problem? Or will each processor be independent of eachother?

How does this sequential processing scale to a web farm or garden?

Thanks for your help.asp.net does not process pages sequential, it can currenlty process as many
requests as the thread pool size. if your pages are processing sequentialy,
then you have put code on your pages that blocks.

-- bruce (sqlwork.com)

"Bruce W.1" <no@.direct.email> wrote in message
news:4023BDDA.57A8DAAF@.direct.email...
> ASP.NET processes one request at a time, sequentially. If one process
> blocks or sleeps then it brings down the entire application for all
> users.
> This fact is hidden under the rug by Microsoft. It would clearly be a
> problem for any website that has tons of traffic.
> On this I seek specifics.
> Is it sequential per DLL or per page? If one page blocks, on say a big
> database query, will other pages process and respond?
> On a multi-processor server, say with four processors, is this still a
> problem? Or will each processor be independent of eachother?
> How does this sequential processing scale to a web farm or garden?
> Thanks for your help.
bruce barker wrote:
> asp.net does not process pages sequential, it can currenlty process as many
> requests as the thread pool size. if your pages are processing sequentialy,
> then you have put code on your pages that blocks.
> -- bruce (sqlwork.com)
================================================== ======

Wrong. Test it yourself.

When a page blocks, for whatever reason, other requests to the page are
not processed.

Thursday, March 22, 2012

Serious issue: parts of my page render as not logged in, parts as logged in. Help!

I'm having a very difficult time with some of our new pages. We've
moved to a web farm, and it seems in spurts it will come where parts
of my page think the user is logged in, and parts think the user is
not logged in. It seems to happen to an entire control. (None of the
controls have OutputCache set)

For example, our login control on top will appear showing the user is
logged inw hen they have been redirected to RegNewUser, but RegNewUser
will display instead of redirecting as if the user were actually
logged in.

The MachineKey option in the web.config is set to a generated SHA1, so
the viewstate moves between the web servers just fine.

This seems to come in spurts where it will happen to a lot of users at
once, then it will stop coming. This is a serious problem on a
production website, I just don't know where to turn or how to debug --
everything looks fine!

I am also getting Forms Authentication failed events in my log:

Event code: 4005
Event message: Forms authentication failed for the request. Reason:
The ticket supplied has expired.
Event time: 4/11/2007 12:42:27 PM
Event time (UTC): 4/11/2007 7:42:27 PM
Event ID: 0a0a593d17984b41aa13b93254491326
Event sequence: 1161
Event occurrence: 13
Event detail code: 50202

Application information:
Application domain: /LM/W3SVC/1/Root-2-128207889508981002
Trust level: Full
Application Virtual Path: /
Application Path: E:\htdocs\mysite-pri\
Machine name: WEB1

Process information:
Process ID: 400
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Request information:
Request URL: http://www.mysite.com:8080/default.aspx
Request path: /default.aspx
User host address: 10.10.1.1
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Name to authenticate:

Custom event details:Make sure the cookie path is the same on all machines. Make sure that the Web
Site number (e.g., /LM/W3SVC/1/Root-2-128207889508981002 - the "/1/" after
W3SVC) is the same.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"pcloches@.gmail.com" wrote:

Quote:

Originally Posted by

I'm having a very difficult time with some of our new pages. We've
moved to a web farm, and it seems in spurts it will come where parts
of my page think the user is logged in, and parts think the user is
not logged in. It seems to happen to an entire control. (None of the
controls have OutputCache set)
>
For example, our login control on top will appear showing the user is
logged inw hen they have been redirected to RegNewUser, but RegNewUser
will display instead of redirecting as if the user were actually
logged in.
>
The MachineKey option in the web.config is set to a generated SHA1, so
the viewstate moves between the web servers just fine.
>
This seems to come in spurts where it will happen to a lot of users at
once, then it will stop coming. This is a serious problem on a
production website, I just don't know where to turn or how to debug --
everything looks fine!
>
I am also getting Forms Authentication failed events in my log:
>
Event code: 4005
Event message: Forms authentication failed for the request. Reason:
The ticket supplied has expired.
Event time: 4/11/2007 12:42:27 PM
Event time (UTC): 4/11/2007 7:42:27 PM
Event ID: 0a0a593d17984b41aa13b93254491326
Event sequence: 1161
Event occurrence: 13
Event detail code: 50202
>
Application information:
Application domain: /LM/W3SVC/1/Root-2-128207889508981002
Trust level: Full
Application Virtual Path: /
Application Path: E:\htdocs\mysite-pri\
Machine name: WEB1
>
Process information:
Process ID: 400
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
>
Request information:
Request URL: http://www.mysite.com:8080/default.aspx
Request path: /default.aspx
User host address: 10.10.1.1
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
>
Name to authenticate:
>
Custom event details:
>
>

Tuesday, March 13, 2012

SERVER APPLICATION ERROR

Hi im an ASP.NET novice..but i am having an issue. Every time I run my web application i get this error, and it tells me to check the event log. When I do, I get the following message from 'W3SVC':

The server failed to load application '/LM/W3SVC/1/Root/XXXX'. The error was 'Class not registered
'.
For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.

For more information, see Help and Support Center at

The other peculiar thing is that my no longer existing favicon is still there when I try to open the web app

I am very confused and appreciate all teh help I can get.

--Jon--

Hi,

this is a known issue. follow the suggestion below:

This problem is related to Component Services, and when you open Component Services MMC, you will most probably get Error Code 8004E00F COM + was unable to talk to Microsoft Distributed Transaction Coordinator. So, fix the COM+ services first by using the following KB.
PRB: Cannot Expand "My Computer" in Component Services MMC Snap-In
http://support.microsoft.com/?id=301919

If the above didn't solve it, and you still receive the 'Class not registered' error message, then you need to recreate the IIS packages in COM+, try

a) Delete IIS related package in Component Services MMC
? IIS In-Process Applications
? IIS Out-of-Process Pooled Applications
? IIS Utilities

b) Open command prompt, navigate to %windir%\system32\inetsrv folder, and enter (case sensitive)
c:\winnt\system32\inetsrv\>rundll32 wamreg.dll, CreateIISPackage
then
c:\winnt\system32\inetsrv\>regsvr32 asptxn.dll

c) EnterIISRESET at command prompt to restart IIS services, then re-open Component Services MMC to verfiy the IIS packages are recreated.

origional post at :http://msmvps.com/blogs/bernard/archive/2005/03/22/39216.aspx

Hope my suggestion helps :)

Server Application Unavailable

I'm having a tough time with an asp.net application.

I'm running Win 2003 Server with IIS 6.0 and .Net 1.1 Framework.

Each time I try to access the app from a browser i get the following error.

----------------------------
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
----------------------------
Here's a entry from this mornings log file. It refers to the page I'm trying to access.
----------------------------
2004-08-18 10:02:14 10.1.5.242 GET /ConcoWebAppX/SiteContacts.aspx SiteID=1268 80 - 10.1.5.242 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+.NET+CLR+1.1.4322) 500 0 0
----------------------------
I have security set to the local IUSR_MACHINENAME account from the root down, the Authenticated Access has been tried with both Integrated Windows Authentication and nothing checked.

The Execute Permissions under the Home Directory is set to scripts only.

I'm really at a loss.

Can anyone steer me in the right direction for an answer as well as a best practice?

Thanks.

Doug DexterDid you try removing all code from the page and re-running it to ensure that it is not a coding error (for example a never ending loop)?
The code runs in development, and has even run on this 2003 server and there are several .Net pages affected by this, not just the example I've shown.

So I'm certain it's a permission issue.

Thanks.
does it involve database ?
Yes.
This thing is driving me CRAZY...

It works on XP PRO...

But it REFUSES to run on Server 2003...

Hasn't SOMEONE had this problem?
FIXED.

In the web.config file set the following:


<authorization>
<allow users="*" /> <!-- Allow all users --
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>

John 3:16

dd

Server Application Unavailable

It's getting to be desperation time for me. I have an app which has been working for 2 years and suddenly I am getting the error above. I am using ASP.NET 1.1. I have data and programs locked up with this problem.

Is this error an alias for some other problem? The error is the same with friendly messages on or off.

The MSFT site says to edit the processModel section of machine.config, but that did not work. At any rate, yesterday when prog was working, processModel was commented out, as it still was today. I have never messed with ASPNET user account.

Both my web server computer and development computer have both ASP.NET 1.1 and Studio.Net 2003 installed, & both have developed this problem, almost at the same time. They are not connected via any network, though.

At any rate, I don't think the problem can be machine.config; it has not changed. Are there "correct" settings for the ASPNET user account? I've never set any password. Is there some default which can be changed? Any help would be greatly appreciated.

Many thanks
Mike Thomas

Take a look in the Event Log. The error should be logged there.

HTH,
Ryan