|
I am writing a static class with four static members using C#.NET.
This class is being used in the application.
I want to make this class common for diffrent instances of the application.
Static class instances must not be created seperately for each instance of the application.
Application(Asp.Net) variables cannot be used here as it is Windows Application.
Thanks,
Nagaraj
|
|
|
|
|
You can't. The objects are only accessible from within the app domain.
What is it you are trying to do?
If you are trying to pass data between app domains you could consider remoting[^], WCF[^], or this article[^]
Simon
|
|
|
|
|
|
You can use IPC[^] for exchanging data between process. .Net Framework includes classes for IPC.
|
|
|
|
|
Hi there
I am in a strange scenario. I have written a Windows Service (in C#) which downloads XML files, processes them and produces a certain output. Now, for debugging purposes I have created a class which runs this service without installing the service first, so it makes debugging easier. (No, it just runs as an ordinary application).
It works like that 100%. Now as soon as I use the service class as the starting point, (to launch it as an actual windows service), install it and run, it runs but every time it tries to download something, it gives me a time out message to a url that is not even the url it is supposed to visit.
Does anyone know what this could be?
It is a LocalSystem based service on an open (yet safe) network, so there is no username/password credentials, no firewall interference, etc. Could it be a policy or something?
To make sure it wasn't something I did in my code, I created a new windows service project to test:
<br />
public partial class Service1 : ServiceBase<br />
{<br />
public Service1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
protected override void OnStart(string[] args)<br />
{<br />
System.Diagnostics.Debugger.Launch();<br />
WebClient client = new WebClient();<br />
string text = client.DownloadString("http://www.google.co.za");<br />
File.WriteAllText("c:\\temp\\output.txt", text);<br />
}<br />
<br />
protected override void OnStop()<br />
{<br />
}<br />
}<br />
It does exactly the same thing.
Thanks
Regards,
LA
|
|
|
|
|
Ok, I now know it is something wrong on my DEV machine.
I have copied and installed this on a different machine and it downloaded the Google page and created the output to c:\temp\output.txt correctly.
Hmm... so I wonder whats wrong with my dev box?
- Last Attacker
|
|
|
|
|
Is windows firewall turned on?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hey John
Thanks for the reply.
Yes the firewall is on but I don't see how that could effect the service.
Anyway, I spoke to the guys here to redo my PC, so pretty soon (hopefully) I shouldn't have that problem anymore.
I am testing the service now off another machine in the mean time so its fine. The one which I had a problem with initially.
Thanks again.
- Last Attacker
|
|
|
|
|
Hi,
I have gridview,if i select the gridview means cursor may change to hand sytle..
I had used this code for hand style..
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand'";
but this code works good in internet explorer,but not work in firefox.
let me know what should i use to change the cursor style in firefox..
Thanks
|
|
|
|
|
e.Row.Attributes["onmouseover"] = "this.style.cursor='pointer'";
You should use css for that kind of tasks,though.
Best regards.
J.
|
|
|
|
|
Hello,
In order to test my web service I am going to install windows 2003 on vmware and deploy web service on it. Is there anything I should consider either while installing windows 2003 on vwmare or while deploying web service so that I don't have problems accessing the web service from the clint?
Thanks.
|
|
|
|
|
I believe the main concern would be debugging. If I remember correctly, you must:
- install Visual Studio on the server
- modify web config
Also if you debug the web service, the debugger will attach itself to the IIS process so no-one is able to call any other web services while you are debugging.
One article which could have useful info to you: http://msdn.microsoft.com/en-us/library/e0ee8xf8(VS.80).aspx[^]
Also all basic elements should be configured correctly:
- you can communicate with the port listening on server side
- possible ssl configuration
- timeout configurations (especially if you're debugging) etc.
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Thanks. Is there anything to consider because of vmware?
|
|
|
|
|
None that I'm aware of. I use both wmware based servers and 'normal' servers for web services. Nothing has been differently. Of course the wmare must have access to the real network card, but that's obvious
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Thanks again. Will try tomorrow
|
|
|
|
|
No problem, good luck
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
|
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
I have an .net app that runs when pc start but unfortunately it get crash sometimes and gives a .net framework error. I think that error is about .net not loaded. I've tried to run it through registry and startup folder in programs menu. I want that app must have high priority to run like graphics and sound app.
any idea ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
What is the full error message?
Is anything logged in the event log?
Simon
|
|
|
|
|
i dont remember as it occurs sometimes. I found nothing related to it in event Log.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
It's difficult to diagnose without the error. I suggest you write it down in full next time you see it. (Some errors you can copy by hitting Ctrl+c)
There should be no problem running a .net app from the start up folder or the registry.
Does the machine definitely have the correct framework installed? Is you app dependant on anything else like a service that may be taking time to start?
Simon
|
|
|
|
|
no it just a simple app that write and read some fake dll files
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Could it be a permissions thing? What user are you login in as? Where are the files you are reading/writing. Does the user have permission to read/write to that location?
Simon
|
|
|
|
|
no need for permission. User login as admin. As i got the error again i will post here
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|