|
You have an excellent answer from Wayne (got my +5) here to the question of how to "trigger" a bunch of clicks, but the fact remains that MouseClicks go in an event queue which is sequential.
The mind boggles that the new parallel extensions to .NET might allow "virtual" simultaneous clicks: but I do think we can safely leave out the idea you are using multiple-mice
So I am curious to ask you what your purpose is here ? What does this secondary "cascade" of clicks actually do ?
best, Bill
"It is the mark of an educated mind to be able to entertain a thought without accepting it." Aristotle
|
|
|
|
|
thank you Bill for your interaction, mmmm I know that my question is very strange but i need this to create bugs in games
|
|
|
|
|
Hello all,
I need to run a multi-process app, in which each process keeps 20-40 threads that keep an object state and performs calculations based on the state of the object, ON DEMAND (from the main thread).
Each thread performs a discrete calculation and returns an answer (to the main thread), and then WAITS for the next request
What's the best practice for this kind of app?
Should I keep all objects in the main thread and create new short-life thread that perform only the one action,
OR
Keep the threads alive, and have them use WaitHandle to wait for the next request,
Others suggestions are most welcome?
Tzumer
|
|
|
|
|
Edo Tzumer wrote: Others suggestions are most welcome?
Upgrade the threads to processes; you said multi-process, meaning that you could simplify the architecture to something that runs an external process on demand and catches it output. The external process would then become a small console-app, containing the threading-code. That would mean more isolation and simpler maintenance.
Edo Tzumer wrote: Should I keep all objects in the main thread and create new short-life thread that perform only the one action,
OR
Keep the threads alive, and have them use WaitHandle to wait for the next request,
You'd only keep the threads alive if it were too expensive to recreate them. Short-life threads is what the threadpool is for, albeit you might want to check out the Smart Thread Pool[^]-article.
Bastard Programmer from Hell
|
|
|
|
|
Tnx,
Can't upgrade them to processes though,
the whole constelation is already one process with many threads,
and there are many processes like this one on the same server, doing the same work in parallel, (and many servers doing so in parallel if we already mention the system, but that does not change the question),
apart from that a process sounds like a major overhead and there's the problem of sharing information, since I need to use objects on the main thread, in each of the calculations.
Actually the tip on the thread pool sounds great, it's the approach of having the objects live in the main thread, but perform the alleged calculation in a thread, but INSTEAD of creating and killing them, to use a thread pool,
Gee, that sounds like a great idea!
thanks a bunch mate, I will dig into the concept...
Tzumer
|
|
|
|
|
If you are using a high enough version of .NET, I'd suggest that you look into the Task Parallel Library. Honestly, this library makes so many things so easy to do - you'll love it.
|
|
|
|
|
Tnx again!
Guess it was worth it moving to .NET 4 last August...
Tzumer
|
|
|
|
|
Anyone know how I can sniff a process? and not every process?? in the below source code By Hitesh Sharma:
A Network Sniffer in C#
Thanks you all.
|
|
|
|
|
You should ask the question in the article's forum rather than here
No comment
|
|
|
|
|
What you are looking for is something like a process explorer that would give you a list of processes.
You can use the Process class.
Process[] list = Process.GetProcesses();
foreach(Process proc in list){
Console.WriteLine("Process: {0} ID: {1}", proc.ProcessName, proc.Id);
}
|
|
|
|
|
Well, I want to Sniff the connection of a Process, dunno if I can do that really... its it possible?
|
|
|
|
|
terrinfo wrote: I want to Sniff the connection of a Process
What exactly do you mean by this? Sniff what, connection to what?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Lets say that I got a program running and it got it own (PID) 3250
With the code I posted above, I can sniff the network (inconming and outgoing traffic in my IP)... but I would like to just "sniff" that process: 3250.
Another way, is to get all process PIDs from those traffic I am sniffing, then I can filter the process PID I want to look at.
Hope you that can understand me now!
Thanks very very much.
|
|
|
|
|
If the process id is held inside the network messages then it should not be too difficult. If the process id is not part of the messages then you would need to find the link from the routing tables and port numbers.
However, since this question really refers to a published article I think you would be better asking the question in the forum at the end of the article.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
ipNode.Nodes.Add("Ver: " + ipHeader.Version);
ipNode.Nodes.Add("Header Length: " + ipHeader.HeaderLength);
ipNode.Nodes.Add("Differntiated Services: " + ipHeader.DifferentiatedServices);
ipNode.Nodes.Add("Total Length: " + ipHeader.TotalLength);
ipNode.Nodes.Add("Identification: " + ipHeader.Identification);
ipNode.Nodes.Add("Flags: " + ipHeader.Flags);
ipNode.Nodes.Add("Fragmentation Offset: " + ipHeader.FragmentationOffset);
ipNode.Nodes.Add("Time to live: " + ipHeader.TTL);
ipNode.Nodes.Add("Source Port: " + udpHeader.SourcePort);
ipNode.Nodes.Add("Destination Port: " + udpHeader.DestinationPort);
ipNode.Nodes.Add("Length: " + udpHeader.Length);
ipNode.Nodes.Add("Checksum: " + udpHeader.Checksum);
There's all except the process
|
|
|
|
|
I thought as much, since the process id is an internal value of meaning only to the operating system, and not relevant to network traffic. However you can find the information you need by using the netstat -o command.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
The problem is that netstat dont show the source IP address of the UDP socket... and its exactly want I am looking for.
I want to know the IP of a UDP connection... Thats why I tried to "sniffer" the connection.
Seems very hard.
|
|
|
|
|
Sorry, but I don't know the answer to that one.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
hi..
I m new to Oracle and c#.still I am tryiyng to picking up stones here
currently I am working on Script Task tool in SSIS (Using c#) in which I need to store the resultset from my Oracle stored procedure in to a MS access table.Below is the code:
public void Main()
{
OracleConnection conn = new OracleConnection();
conn.ConnectionString= "UserId=XXXX;Password=XXXX;Data Source= "XXXXXXX;";
conn.Open();
//execute stored procedure here
DataTable resultDT = new DataTable();
OracleCommand Cmd = new OracleCommand();
Cmd.Connection = conn;
Cmd.CommandText = "My_StoreProc";
Cmd.CommandType = CommandType.StoredProcedure;
OracleParameter[] paramsArray = new OracleParameter[2];
paramsArray[0] = new OracleParameter("fromDate", OracleDbType.Date, ParameterDirection.Input);
paramsArray[1] = new OracleParameter("toDate", OracleDbType.Date, ParameterDirection.Input);
..and here after I am stucked how to proceed with ..
how to use Oracle dataadapter,dataset and store this result set in an Access table?Any help will be appreciated!
Thanks in advance!
BigFish
|
|
|
|
|
You shouldn't use the .NET oracle data provider, because the libraries are deprecated.
A cite:
Quote: The types in System.Data.OracleClient are deprecated. The types are supported in version 4 of the .NET Framework but will be removed in a future release. Microsoft recommends that you use a third-party Oracle provider.
Source:
Oracle and ADO.NET[^]
|
|
|
|
|
Hi there.
I am using .NET Oracle.DataAccess.dll..
I m pretty sure that it can be done.Can anyone lead me till the dataset fill?
Regards,
BF
|
|
|
|
|
What Rex said is that while it works now it will not work in the future, change your data provider before going any further.
I would extract the data into a table/list via the data connection, create another connection to the Access database and write the table/list to the destination table in Access.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
1. Write code that ONLY gets data from Oracle. If the result set is large then create a streaming idiom. You extract the results into a data structure written in C#.
2. Test it.
3. Write code that ONLY puts data into Access. You use the above data structure.
4. Test that.
5. Put 1 and 3 together.
|
|
|
|
|
Hi,
I was wondering if anyone could help me. I have a solution which contains three projects. One for data access , one for business logic and the other contains for the winforms them self and is set as the startup project.
In my winform I create instance of a method which is in BLL project. This creates the controls dynamically based on some fields in the database. I also attach the button click evens in this class. On the button click event I need to update the text in a label. How would I go about this?
If I move the class file in to the starup project I can update it by passing the form name and updating a property. But I would like to keep the class file in the BLL project.
Can anyone help?
Thanks
|
|
|
|
|
Creating controls is not business logic. This should be done by the UI layer. What the business layer should return is some object (probably a IList<FieldDefinition> or similar where FieldDefinition includes the metadata about the field that you're going to need in the view) that defines the database fields that you want controls made for.
You have done the right thing by separating the three parts, try not to smear things across those lines if you can avoid it!
|
|
|
|