|
|
i have a window service and window application two different projects.
i am hendling a window service through window application for start, stop, Restarting the service. i am checking service using Timer in window Application for every 500 interval. but i want it without using Timer it should check the service status, if i stop service(in services) then it automatically show Stop in Window Application.
Thanks
Sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
There are several ways to do this.
One easy way is to write it to windows log entry using the EventLog class. In the service you'll create a source with your service's name, and in the Stop() method of the service, you write an entry to the Log. In the applications use the same class to monitor that log. When an entry is written an event called EntryWritten will be raised.
PS.
This may not work when you service has been forcibly ended using the task manager.
Regards
|
|
|
|
|
Hi,
How can i passed values from one form to another form without using help of constructor.
suppose FormA has a variable i=4 that values i want to send to FormB.
it can passed by constructor. like FormB oFormB=new FormB(i).
But i want to know that is there any other way to passing value.
Pls help me if possible give a example with code.
thanks.
|
|
|
|
|
|
yes, u can create a static class and set the property from one class and then access it from another class...
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
FormA
{
public static string GlobalVar;
}
FormB
{
FormA.GlobalVar = "parameter to be passed";
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Try to you delegates.................. to pass the values
My small attempt...
|
|
|
|
|
hello every one , i have a windows service and i want to expose the methods inside the windows service as a com object how can i achieve it.
thank you
|
|
|
|
|
I have multi dimensional array, which has to be produced in report (.rdlc)
microsoft's reports
i hope i should use object data source, but i am unable to make it up... (ARRAY) i know how to do it with variables...
kindly help me out
|
|
|
|
|
I am displaying records from an MS Access Database. One of the fields is the person's marital status. To conserve on space, I have saved it as a short Int: 0=Unknown, 1=Single, 2=Married...etc. What I'm trying to do is convert that numeric value to the textual value when it is displayed in the DatagridView. I am toying around with some ideas but they all seem too time consuming. Does anyone have any ideas on how to go about this?
|
|
|
|
|
hi,
I have idea like this. In design mode, you add column collection in datagridview. With material status column, you do choose DataGridViewComboBoxColumn with items (0 - Unknown, 1 - Single, ...).
You must add each record in MSAccess into datagridview in code. That's all.
hope my help.
P/S: I'm not sure we can do your idea.
|
|
|
|
|
Thanks for the information. I was thinking about creating a column like that with code. One thing that seems too time consuming is looping through all the records to set the appropriate value. Do you know if the DataGridView has a way to trap the event of a row being created? That way the cpu wouldn't have to do double work.
Thanks again for the help.
|
|
|
|
|
Hi All:
I have the following algebraic equations I want to code in C#. I am not sure how to do this. Please help!
495 = 66t + c
951 = 190 + c
How do I write this in code?
Thanks,
Laura
|
|
|
|
|
Sorry the equations are actually:
495 = 66t + c
951 = 190t + c
Thanks! Please Help!
Laura
|
|
|
|
|
Are you looking for an algorithm for solving two simultaneous equations[^]? And you want to code that in C#?
Make sure you understand the algorithm first without being concerned about how to implement it in C#. Once you have a strong handle on the algorithm, you can then begin to consider how to implement it in C#. The above link describes three approaches.
|
|
|
|
|
You must use the matrix.
for ex:
2x+6y=8
3x+2y=5
|8 6|
|5 2| -14
x=-----= --- = 1
|2 6| -14
|3 2|
|2 8|
|3 5| -14
y=-----= --- = 1
|2 6| -14
|3 2|
sol x=1 y=1.
|
|
|
|
|
this method works for n Equations n Unknows.
FOR 2 Equations 2 Unknows
For one system like this:
{a*X+b*Y=c
{d*X+e*Y=f
the part of code ar:
if (a*e-d*b)
{
X=(c*e-f*b)/(a*e-d*b);
Y=(a*f-d*c)/(a*e-d*b);
}
else
{
MessageBox.Show("Many solution!!!");
}
PS:
The determinant
|a b| is equal with a*d-b*c
|c d|
math my love
|
|
|
|
|
Hi,
If I set up a http server on a pc in a LAN with NAT firewall
(the ip of the http server obtained by checking the "IPConfig" of the pc), then can other pcs outside the LAN access my http server with the ip ?
If not, how can the MSN Messenger and other IM access throught the NAT firewall ?
Thanks
|
|
|
|
|
Hi
Well that doesn't sound like a c# question...
anyway.. there are possibilities to do this.
1. you can configure a port-relay on the firewall (all connections to the router on a specific port are relayed to a specific lan-address)
2. if you have more than one address and you have an firewall with that fuction you can also configure an address - relay (all connections to one of your external addresses are relayed to a specific lan-address)
i think reading the manual could help you on this for more details
msn messenger an other IM work different. i'm not 100% sure about it but i guess they work like this:
if you want to send a file from one IM to another they
1. try to connect from the sender to the receiver
2. if 1 didn't work try to connect from receiver to sender
3. if 2 didn't work send the file via IM server
greets
m@u
|
|
|
|
|
I have a pocket PC which I would like to request data from a xml file on a website and loop thru all the nodes. So I have the basic testing application, but I have two problems.
When I am in the emulator state and I try and request a URL of a very simple file which the contents of the html are only "blank file" then during runtime I get a error that says...
WebException was unhandled
This code is the exact same code I use on a desktop application, does anyone know why the below code would report this error?
string xmlLoadFrom = "https://www.domainhere.com/test.php";<br />
string strResponse = "";<br />
WebRequest req = WebRequest.Create(xmlLoadFrom);<br />
req.Timeout = 1800000;
WebResponse resp = req.GetResponse();<br />
StreamReader sr2 = new System.IO.StreamReader(resp.GetResponseStream());<br />
strResponse = sr2.ReadToEnd().Trim();<br />
sr2.Close();<br />
resp.Close();<br />
<br />
MessageBox.Show(strResponse);
The error occurs on this line
StreamReader sr2 = new System.IO.StreamReader(resp.GetResponseStream());
|
|
|
|
|
Hi,
Wasn't sure exactly what forum to post this to, but in case this could be a problem in my code (C#), I decided to post it here.
Having a very strange problem here. Have a custom control. Inherited from ListView. I call it ImageView. Have a custom property on it called Thumbnail which itself is actually an object with multiple properties. Using a custom TypeConverter which inherits from ExpandableObjectConverter. Have a form with the ImageView on it. I open Visual Studio and open the form without making any changes to my project or compiling. The string to object (and vice versa) conversion for the Thumbnail property works exactly as it should in the property grid for the ImageView. I make a change...ANY change...to my project and recompile, it breaks. After recompiling, I open the form and in the textbox to the right of the Thumbnail property name in the property grid reads the full namespace.class.class string instead of the custom text which represents the property settings. I modify the text, but even if I change to something that should convert to the object, it gives me cannot convert to System.String errors, object not instantiated errors, and casting errors (not all at once, but I've gotten at least one of each of these errors throughout my troubleshooting). Without making any changes, I close out of VS (just closing the form or closing the project doesn't do it, I must close completely out of VS), and then open VS again, open the form without making any changes or compiling, it works. As soon as I make a change anywhere (even just adding a file to the project) and then compile, it breaks. I'm using VS Standard Edition w/ SP1. It was doing this before SP1 and continues to do so afterwards. I've tried repairing VS, even uninstalling and reinstalling, to no avail. I've tried creating new projects and creating quick small objects and converters and adding them to an inherited control within the new project. Happens then, too. Oddly enough, though, it seems this started happening when I made a class name change with one of the other expandable properties I already had on the ImageView. It seems lots of things went haywire when I did that. Got everything worked out except this. Since then, I haven't been able to kill this bug. Have any of you experienced this? Could this be a bug in VS, or could there be something strange with my code that would be causing this?
Sorry for the long-winded post. Strange and complex issue. Wanted to get all the details in.
Thanks
Rob
|
|
|
|
|
Hi..
If you put the your ImageListView into a DLL Project and refer to it from your EXE Project you won't have the problem anymore.
greets
m@u
|
|
|
|
|
Well...you are correct. I did exactly that and problem solved. Now my next question. Why? What's different about referencing the dll into the project that makes that work right?
Rob
|
|
|
|
|
Nevermind...still have same problem. Except this time, when I make a change in the DLL project, compile it, then go to the EXE project and pull the changed reference in, compile, the same thing is happening in the property grid as described above as soon as I open the form with the ImageView on it. If I then close out of VS, relaunch VS, and go directly into the EXE project, open the form, it's fine. Close EXE project, open DLL project, make ANY change, compile, close DLL project, open EXE project, pull in new reference, compile, open form, broken. Immediately close VS, relaunch VS, open EXE project, open form, it's fine. There is still definitely a problem here.
Rob
|
|
|
|