|
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.
|
|
|
|
|
|
YAP I GOT IT AND TNKS TO YOU.
|
|
|
|
|
Also remember that an IP address may have several things behind it. The IP address I have has Windows XP, Windows Media Centre Edition, a Windows Mobile device and an XBox360 routing through it.
|
|
|
|
|
Easy. A client-side Java Script component. The code that shows the machine details is running in the BROWSER, not on the server side.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I have a problem to understand a pointer thing under .NET:
I have built an unsafe class in which I access the bits of a bitmap using a rgb-struct-pointer:
(RGBTRIPLE*)(ptBits + iY * iPitch + iX * sizeof(RGBTRIPLE));
with
[StructLayout(LayoutKind.Sequential)]<br />
public struct RGBTRIPLE <br />
{ <br />
public byte rgbtBlue;<br />
public byte rgbtGreen;<br />
public byte rgbtRed;<br />
}
It works well with both a locked System.Drawing.Bitmap, and an image, which I loaded externally using "FreeImage.dll".
So for my understanding I have the same image data structure in memory: the locked GDI+ Bitmap and the FreeImage-bitmap and in both cases I have got a pointer that points to the structure start and in both cases I use the same 24bit-struct to access the pixels.
But nevertheless reading the locked GDI+ Bitmap is approximately 30% faster than reading the FreeImage-bitmap.
Is there maybe a difference located behind the pointer access? Do you have any comment or explanation for that phenomenon?
Thanks,
Alex
|
|
|
|
|
Can someone help me, Please. I am trying to take a class in C#. The instructor has a set of problems for us which uses methods and the calling statement. For some reason I can't seem to figure out how these work. The way I understand it is that the method is a series of statements that do something and the call is supposed to have them do that and get a return out of it.
Can someone please give me a clue as how these things are supposed to operate, because I can't get them to do anything. I've been banging my head on a wall because the information isn't sinking in.
Any help will be apreciated. Thank you.
|
|
|
|
|
OK, basically a method is a group of C# statements that do something. They can do *anything* you like, but typically the idea is that a method is like a building block. Once you have the mould, you can make all the blocks you need. Once you define a method, you can call it whenever you like.
namespace test
{
static void Main()
{
Method1();
Method2();
Method1();
}
private void Method1()
{
Console.WriteLine("in method1");
}
private void Method2()
{
Console.Write("not ");
}
}
So, this example is trivial, usually a method would do a calculation, or connect to a datatabase, or some other 'useful' thing. The point is, I have two methods, and I can call each, as often and whenever I like. This means, for example, if my database won't connect, I know the database connect method is where I look for an error, instead of having one big clump of code and trying to work out which bit is running when the problem occurs.
You can also pass values into a method, and you can return values. A canonical example would be
private int Add(int x, int y)
{
return x + y;
}
No-one would write a method like this, but you see that to call this method, you need to give it two numbers to add, like this:
int total = Add(1, 6);
The variable called 'total' now equals 7. You can also pass values from variables, like so:
int v= 27;
int n = 1042;
int e = Add(v, n);
You'll note, the names don't have to be the same, you can use whatever names you like, they don't need to match the names given within the method signature, those names only exist so you can refer to the values within the method.
Does that help ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Would this work if you passed a variable from a GridViewEvent method to a DataListRow method within the same class?
|
|
|
|