|
I see...
I'll read some articles about the subject, to get a deeper understanding.
Thanks again.
|
|
|
|
|
Colin Angus Mackay wrote: If your class holds onto any large amounts of memory, or unmanaged resources or any class that does then you should implement the IDisposable interface.
Actually, using large amounts of memory is not any reason to implement the IDisposable interface (unless it's unmanaged memory, of course).
The garbage collector doesn't sort out the objects that can be freed, it sorts out the objects that needs to be kept, and frees everything else. If you remove the reference to an object, the object and all it's members will be garbage collected all at once. As there are no references to the object, the references that it contains are not considered when sorting out the objects to keep. By removing the reference to an object, you also effectively remove all references that it contains.
---
single minded; short sighted; long gone;
|
|
|
|
|
And why would it be? Even after closing the form you may want to show it again.
|
|
|
|
|
It's the main form, so when its closed, the application is closed.
|
|
|
|
|
I'm writing a client/server application, and I want the client pc to shutdown when
receiving a specific value from server, so my question: is there any way to shutdown
or restart computer from within C# code?.
|
|
|
|
|
You can use the API call, or WMI to do it:
http://pinvoke.net/default.aspx/advapi32/InitiateSystemShutdown.html?diff=y
WMI is shown in VB at the bottom. Easy enough to convert that to C# though.
--
Real programmers don't comment their code. It was hard to write, it should be hard to understand.
|
|
|
|
|
in my solution , when i devide two number , the result is '2.3333333333333333333333333333', so it got error!!!
Parameter value '2.3333333333333333333333333333' is out of range.
how could i manage it?!!
any help could be useful.
|
|
|
|
|
What are you trying to do with the parameter? Show some code, it will help us see what you are doing.
|
|
|
|
|
I've made a windows service and give it the task to write current time at regular intervals of 5 sec.
It worked good at debug mode but when I starts the service from service management it do nothing.?? Al the code that is written in the service start method is correct. Any suggestion??
Please fast.
Thanks
Syed Shahid Hussain
|
|
|
|
|
Syed Shahid Hussain wrote: I've made a windows service and give it the task to write current time at regular intervals of 5 sec.
It worked good at debug mode but when I starts the service from service management it do nothing.?? Al the code that is written in the service start method is correct. Any suggestion??
Where is the time being written to. Does the user that the service is being run under have permissions to write to that location?
If you are trying to write to the UI, has the service been given permission to interact with the desktop?
|
|
|
|
|
I've given two tasks to the service first it creats a file in c:\ that is ???.db and a temp file that is ???.temp. when service starts it creats two files and save current time in ???.db file and when the service stops it deletes the ???.tmp file.
Now both files are created successfully and the ???.tmp file is deleted successfully also but the time is not written in the ???.db file.
I'm new to services. Now gie me the exact solution.
Thanks
Syed Shahid Hussain
|
|
|
|
|
You put the code into the Service Start method?? Nope. A Windows Service should start a seperate threaded component from its Start method. That component is what does all the work of the service you write.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I've written the action code in start method already.
Any more suggestion.
Thanks.
Syed Shahid Hussain
|
|
|
|
|
Then you'll have to rewrite it. The start menthod is used for starting the service code up, not doing the actual work of the service.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks i've found the problem that is ; i've used a System.Windows.Timers.Timer control in the service but i have to use System.Timers.Timer object in my service.
Take Care.
God Bless You.
Syed Shahid Hussain
|
|
|
|
|
Thnx,,
Db goes like...
Source Destination Distance
A B 1 //these r entries
now, A is filled in combo1 n b in 2nd.i did it by reader.
But at unable to generate the distance(although query i correct).
|
|
|
|
|
Your message looks like a responce to this[^]. Please press the "reply" button in the appropriate post to reply to it. DO NOT START A NEW THREAD!
|
|
|
|
|
helloz,
how i can convert from hexadecimal to char, i dont want to convert 1 char by 1 chat i want to convert a string of hexadecimanl values like
string dd = "00640065006600670068";
i know that i can ceonvert a single one as
string gg = "\u0064";
but i want to convert a whole of string dd
there is a problem if i define a variable string as:
string hh = "\u";
and i dont want to define it as:
string jj = "\\u"; or @"\u"
because it will give me "\\" not a single one
Thanks alot
Hamody
|
|
|
|
|
Hey guys, i got the solutution which is:
private string HexAsciiConvert(string hex)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i <= hex.Length - 4; i += 4)
{
sb.Append(Convert.ToString(Convert.ToChar(Int32.Parse(hex.Substring(i, 4), System.Globalization.NumberStyles.HexNumber))));
}
return sb.ToString();
}
Thanks alot
Hamody
|
|
|
|
|
i am trying to calculate the distance between two places.
i filled the two combos with source n destination through data reader. Distance between them is also stored in the same reader.
anyone can plzz tell me the method to display it on Label.
sincerly,
Shriya
|
|
|
|
|
So you have two combo boxes, and each combination of selections, has a distance stored in your database ? Wouldn't it be more efficient to store their locations and calculate distance ?
Anyhow, you need to find the entry in your DB that has this pair of values, so either search the table you have, or select just that one value with the two fields that match.
Hard to say more without knowing your DB schema.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to know the name of the operating system by giving a IP address. How i will do this. Plz any one help me.
|
|
|
|
|
That's not possible. Some web sites use script to somehow get that info, but you won't get it from an IP address.
Google for security software, you're bound to find a page that reports details of the PC. Do a view source on it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
then how mcafee do this. They gives the detail of operating system info even linux description (i.e. samba,ubuntu).It even gives the router description. here mcafee is not installed.if you know any link plz send it to me.
|
|
|
|
|