|
I'll read what you sent and see if I can figure out a good way to change it differently. I mean I have to pass a custom object between the agent and server. That Operations object is a custom object. So if I ever did updates inthe future I would just add it, and then the server would be updated and agents as well.
|
|
|
|
|
Yep, I know what you mean. My very first client-server solution architecture was really very similar to yours. It was simple and worked very well, but as requirements grew up the maintenance became a pain in the neck. Every change required a new server version and a new client version, and every new piece of software had to be deployed everywhere within the less period of time, becouse there were usually compatibility issues between the new versions and the old ones, and many other headaches.
My last client-server architecture is absolutely different. The communication layer is stable, I mean, no matter what information comes and goes, this layer can handle it without any change. Both, client and server layers can be easily extended: there is no need to recompile them. Still more, there is no need to stop them. Each one of these two sides is a simple application which only has to load or unload plugins. I don't even have to change the database structure. When there is a problem with a plugin I only have to change, recompile and replace its library. Sure, the associated module will not be available during the change, but the rest of the application will keep working.
|
|
|
|
|
I think I see what your saying but I just can't wrap my head around what I should do. I mean I have to pass a certain data structure because this information will be getting stored in a database. So the columns have to match up some way or another.
Unless I'm making the clients pass the SQL commands and parameters along with the values to the server, it only seems like if an update was to happen it would have to update the server and clients.
|
|
|
|
|
You didn't happen to write an article on this did you? I would like to see similiar code so I can better understand what I need to do. As I sit right now I am unable to come up with a better solution than passing my custom object (differnet compiled dll) back and forth. The client sends the custom object, the server reads it, and depending on which task was set it calls a different method to insert the data (or update) into a SQL database.
|
|
|
|
|
No, sorry. Actually I thought about that possibility, but after considering what should be included I noticed it should be too large: it should cover several OOD principles and patterns and a huge application of multitier alchitecture, too large as I said and unfortunately I do not have so much time. Anyway, the success of these designs relies on a good abstraction, and I did write an article which intensely uses abstraction and, though it has nothing to do with client-server communication, maybe it can give you some clues in order to get a better abstraction for your application. Here is the link[^].
In the case you describe, for example, the client should send an abstraction of the custom object, the server should read this abstraction and call always the same method on this abstract object to insert the data. How to send an abstraction of a custom object? Well, design an interface and wrap your custom object within a class which implements this interface. This way your server only needs to look at the interface and invoke its methods, so it can work for any custom object (present or future) if it follows the abstraction rules. It is really hard to explain this here: there are a lot of things involved but, as I said before, the key is a good abstraction.
|
|
|
|
|
Hi,
I am programming a softphone in C#. Now i want to monitor the phone(extension) state. The phone is a local phone. I think the best method is with a subscription to an extension and receive the state by notifications from this extension. An example: when a phone is busy, i get a notify and a light will be orange. When the phone is available the light will be green. How can i do this?
Thanks..
|
|
|
|
|
Hello,
I have some executable code which sends a message to some process, this message opens a "save as" dialog. (regular window's dialog)
The question is how can also pass arguments (a path to save in) to the launched dialog ?
Do i need to use my application API, or there is some other way to do it by using windows messages
Thanks
|
|
|
|
|
There is something confusing about your question but I will provide what I think is an answer.
Are you using a SaveFileDialog ? As this has a property called InitialDirectory which you can set to be the path to save the file in...
SaveFileDialog sfd = new SaveFileDialog();
sfd.InitialDirectory = @"C:\my_folders\folder_to_save_in\";
if(sfd.ShowDialog() == DialogResult.OK){
}
I don't think you can force the user to save in that folder only but there are a couple of options if you need that functionality?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Depending on the message you are sending you could add the path as either the WPARAM or LPARAM of the message.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
that's how it works :
IntPtr QTPHandle = FindWindow(null, qtp[0].MainWindowTitle);
SetForegroundWindow(QTPHandle);
SendKeys.SendWait("{F4}");
|
|
|
|
|
OK, obviously my suggestion will not work as you are sening a keystroke to a window, rather than invoking a function within the application. Assuming this is going to an external application then I do not think you can do what you are asking.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
but when i open a "save as" dialog isn't it possible to "catch it" ?
|
|
|
|
|
igalep132 wrote: but when i open a "save as" dialog isn't it possible to "catch it" ?
I suppose it is but I don't know how you would add your path into the dialog without knowing which message to send it. I'm also still unsure whether you are sending the "F4" key to an external application, or merely to a Window of your own application. Whichever you are doing will affect what you can or cannot do.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
the "F4" is for "my" app, and my app launch standard windows "Save as" dialog
|
|
|
|
|
igalep132 wrote: the "F4" is for "my" app, and my app launch standard windows "Save as" dialog
So you just need some pice of communication that will allow your path to be sent to your app. Take a look at Luc's answer (and link) below, it will probably help with what you need to do.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
more precisely, you could pass a pointer to a string through LPARAM, however that pointer must point to some valid memory in the target process; this requires some P/Invoking of kernel functions such as AllocateVirtual, ReadProcessMemory, WriteProcessMemory. I once developed a little LP_Process class that encapsulates all this, see e.g. here: LP#TrayIconBuster[^]
|
|
|
|
|
i have done the encryption for black and white images but the processing time is high as the size increases.i want a help to lower the process time. i like to know how to modify for color images.i have done the encryption using the base paper"A hash based image encryption algorithm" from a journal published by Elsevier
|
|
|
|
|
Why would a colour image be any different from black and white? (in terms of how you process it)
Also, depending on format of image color and black and white may be the same data size
More info on you code please!!!
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
you should implement encryption on either a file or a data stream, that would allow you to encrypt just anything, and performance would only depend on amount of data, nothing else. Whether it is a color image, a B/W image, an EXE file, ... it does not matter.
|
|
|
|
|
In addition to Luc's suggestion of encrypting off a file stream, have you considered compressing before encrypting? Assuming that your images are not JPG (or some other format that is already compressed) you might get a major benefit from compression.
|
|
|
|
|
Hello,
What I am trying to achieve is as follows... I have a database used in an asp.net web app and one of the functions is for a user to download a copy of the database but only with data related to the user. For this I want to provide them with a .MDF file.
What is the best way to create a .MDF file on the fly? From what I understand SQL Server needs to be used but I do not want to create a database in an SQL instance and then have to work out how to detach that database. (This would also be an issue if 2 or more users try to do it at the same time as I would ideally want the database files to be named the same (I have temp folders set up for storing same name files for different users already))
Anyone have any thoughts on this?
Thanks
BTW, apologies for any who think this should go in the database forum (I don't think that quite suits)
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
Maybe you should take a look at Synchronization Framework.
AFAIK you can't use a mdf file outside a SQL Server instance. But you can get .sdf (SQL Server Ce) file from your main database to provide offline access to data.
I can't say much more about that, since I didn't implemented it yet, but I would start searching in that field if I were to deal with such a requirement.
Kind regards.
modified on Wednesday, November 10, 2010 11:04 AM
|
|
|
|
|
Thanks for the reply, will take a look into it. Not sure it is what I am looking for but maybe it will provide a solution in one form or another.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
As an alternative, you could export the data as an Access database, or a zipped XML file. But do check out the sync framework - imagine the user updating his/her own local database, and having the sync framework update your master-database
I are Troll
|
|
|
|
|
I have decided to go for the option of creating a database in SQL Instance, copying what I need to copy and then detaching the database. This allows me to then provide the .MDF file for download
Just to clarify I am not actually looking to provide any kind of re-import of the data. The download is purely for customers to be able to get their data that we are storing on our DB. For whatever reasons they may want
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|