|
Oh and If so how do you perform the actual act of copying?
|
|
|
|
|
|
Hi
The first link you posted I had found today and I've managed to get the code working! Meant to post up here a link but thank you for this.
The second is very useful and great thanks to you for this. My aim for the application is to drag from my application to an external application and such I can imagine the file descriptor being a problem. The tutorial on this section may be able to help with some of the problems that might arise!
Thanks again Jeff
|
|
|
|
|
Hi experts,
I wanted to create a multi threaded windows service, can anyone reply me with the code, i will appreciate it.
The scenario is, i have multiple databases, and i have to connect to each database and do some work after each interval using windows service.
I could not able to find a simple multi threaded windows service code sample anywhere
Help needed, thanks,
Vijay
Vijay
|
|
|
|
|
I would be surprised if anyone would be able to post code for this type of request. I have written a few multithreaded services and can give you some pointers.
1. I usually put all of the code used by the thread in its own DLL, that way you can basically insantiate an instance of you class for each thread and limit the race conditions which can occur between threads.
2. Create a single public method in your class which can be the starting point for your thread, populate class properties with initial values in the Service code then use the ThreadStart or ParameterizedThreadStart methods to start the thread. Once the Thread has started (you can use ManualResetEvents to monitor this) add the Thread instance to an array in the Service code so all of the running threads canbe managed from the service. Doing so will allow you to stop the threads in the event that the service must stop.
3. I've found that .NET remoting is especiall handy with M-threaded Windows Services for sending control / command requests to the threads.
Here is an example of starting a thread:
try
{
m_ThreadStarted.Reset();
Thread ADTThread = new Thread(new ParameterizedThreadStart(ProcessADTThread));
ADTThread.IsBackground = true;
m_MasterThreadList.Add(ADTThread);
ADTThread.Start(DR);
m_ThreadStarted.WaitOne(-1, false);
Lines.Append(DR["ClientName"].ToString() + " Started\r\n");
}
catch (Exception Err)
{
m_ServiceLog.WriteEntry("Start Service WaitEvent Exception: " + Err.Message, EventLogEntryType.Error);
}
|
|
|
|
|
hi all,
is there a limitation of client-server .net socket application that when we broadcast message from server to all connected clients, not all the clients receive it. The condition is we are receiving real time data .
is it a limitation or i'm doing something wrong... any idea?
thanks
Determination and faith are the only keys !
|
|
|
|
|
Do all of the clients have the same firewall and configuration running?
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
yup.
actually all the client's instances are on same machine while server is on other machine
Determination and faith are the only keys !
|
|
|
|
|
Most routers kill network broadcasts. For guaranteed receipt use TCP/IP and send to each client individually.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
i m using tcp connection
thats why confused of not get messages.
it might be a router problem, but what if i run server and 4 clients on the same machine. i 've tested that way too but unsuccessful in receiving 100% messages.
Determination and faith are the only keys !
|
|
|
|
|
Broadcasts are a "best efforts" communication method, you should plan on messages NOT making it to a client if your using UDP broadcast messages.
|
|
|
|
|
the problem is m working on critical real time application in which the scnerio is like i must have to send message to all connected clients. if im using tcp then why there is a message loss, thats amazing to me atleast and wondering if i've done something wrong or that theory fails of reliable tcp connection
thanks
Determination and faith are the only keys !
|
|
|
|
|
Can anyone give me (rookie C# programmer) an idea how to use standard controls that can be dragged to a new location by the user during program execution. I would like to use various controls (TextBox, Button) to graphically represent a continuous beam (structural engineering) containing the member information (length, moment of intertia, cross sectional area, joint details, loads, etc).
Thanks in advance
Ron Modesitt
|
|
|
|
|
This is probably not a rookie task
Just as a starting point I would begin by monitoring the Mouse Button Click events as follows:
In the Mouse Button Down event I would record the coordinates of the mouse pointer and the control being clicked. Then in the button Up event I would check the coordinates of the mouse again. If the delta between the starting and new locations are greater than, say, the size of the control oringall clicked (or some other specific value) then set the Location property of the control to the new coordinates. This approach will not create the dragging effect visually but it should move the controls for you.
Good Luck.
|
|
|
|
|
Many thanks. I agree this is not a rookie task, however, your suggestion is a good idea and one that this rookie understands.
Ron Modesitt
|
|
|
|
|
i want to create left panel like that we used in c# 2005 that i can fix it or hide and visible during mouse move
plz i need this answer today immeditaly
thanks alot
md_refay
|
|
|
|
|
DockPanelSuite on SourceForge is what you are looking for
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
md_refay wrote: plz i need this answer today immeditaly
Along with what lecky said, perhaps you also need rent-a-coder. If you "plz i need this now today 'immeditaly'," you are best off paying someone to do your work. No one here will do it for you, even more so now that you have been very rude. Demanding stuff doesn't usually make things go quicker.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
It is well known most software has undo and redo functions,
but I don't know how to realize them. Should I save all the operations during each operation and then undo and redo it? that should be really complicated to do.
Is there any good way to go for that?
thanks.
|
|
|
|
|
There are a few articles here on CodeProject that simplifies this for you.
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
it depends alot on what environment you are working in.
If you're saving changes to a DB for instance you're going to need to roll back the changes in reverse order taking account of what other users might have done to effect the state of the DB in the meantime.
If you are drawing a poly line and you store the points in an ordered list then removing them one at a time from the end will achieve an undo.
If your application communicates using messages and you can find an inverse for all of those messages then you could store the messages in a list and a pointer to the current position. Redo moves the pointer up one, adding something new deletes everything after in the list etc ect.
Your object could store a collection of serialised versions of itself and each time you change the object you serialise it into its own internal store (hint: mark the collection so that it doesn't get serialised) This might be nice as you could add this functionality to an UndoRedoBase but could potentially use alot of memory.
my 2p
Russ
|
|
|
|
|
Hi guys,
I'm trying to access an SMB share hosted on an AS400 server. The server is nothing to do with the domain security. My windows server needs to periodically access this folder and read/write to some files.
The access security is managed by the server. The path is: "\\qfgmas400\STX\mvx_desp". If i try something like:
DirectoryInfo fi = new DirectoryInfo(@"\\qfgmas400\STX\mvx_desp");
FileInfo[] fia = fi.GetFiles();
I get an UnauthorizedAccessException.
Any ideas how i can pass a username and a password to connect to the share?
Cheers
Will
|
|
|
|
|
I retrevied the Images from Database And Display In datalist.
I used Two Buttons(prev and Next).
Here I place one image control at the top.
At Bottom In datalist All the Images is displaying.
At first in that image control first image will be displaying.
if we click next button then next image will be displayed.
if we click previous button then previous image will be displayed.
Here this buttons is not working.please Send the code In Detail Immediatly.
Its Urgent.
thanks and regards
cwah
|
|
|
|
|
Just use the BindingNavigator control. I did it for the first time today, and it took all of 5 minutes.
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
I retrevied the Images from Database And Display In datalist.
I used Two Buttons(prev and Next).
Here I place one image control at the top.
At Bottom In datalist All the Images is displaying.
At first in that image control first image will be displaying.
if we click next button then next image will be displayed.
if we click previous button then previous image will be displayed.
Here this buttons is not working.please Send the code In Detail Immediatly.
Its Urgent.
thanks and regards
cwah
|
|
|
|