|
You two need to coordinate then. It's getting very confusing answering similar questions from different people.
|
|
|
|
|
There is a system needs to support 3 different protocol. Two protocols uses CGI to communicating, the other one uses self-define protocol base on the TCP protocol. The devices base on different protocols have different properties. So how to do the abstract architecture for this system. I find that it is difficult to design an abstract class to support these two protocol. Because there have a little similar. Does anyone meet the same problem? Or suggest other open source system support different network device?
|
|
|
|
|
First of all, you should ask this in the design forum instead. Secondly, if there's little similarity then don't try and shoe horn it into an abstract design.
|
|
|
|
|
I'm usually sticking to generalizing what they have in common into an interface (altough an abstract class might be preferred under some conditions), with a strategy-pattern to switch between actual implementations.
No, they needn't be 100% equal; sometimes one of the implementations has an extra property, or lacks one. If it lacks the property, we implement a dummy. The "extras" are usually put in a separate class that's embedded in the object, comparable to the composition-pattern.
Can you describe the three items roughly with it's most important members?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Two type device use the some CGI interface to control the device, so these two types have much similar, but the other should use the self-define protocol base on the TCP protocol. I consider one way to define a muster to include these three types command, and defines a muster of pages to show different pages to user by device type.. But I found that this way was too completed.
|
|
|
|
|
yu-jian wrote: so these two types have much similar, but the other should use the self-define protocol base on the TCP protocol.
I see.. two classes, who look very similar. And I see a third class, following the same design, implementing all the members that the other two classes have, but somehow ignoring their calls.
class MallardDuck: Duck
{
public void Quack()
{
System.Diagnostics.Debugger.WriteLine("Ku-wack");
}
}
class RubberDuck: Duck
{
public void Quack()
{
Console.WriteLine("Squeek");
}
}
class SomeDog: Politician
{
public void Quack()
{
}
}
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
yu-jian wrote: So how to do the abstract architecture for this system
Simple - you don't, because you haven't posted anything that suggests that there is any need to do that.
For something to be be abstracted (for the need to exist) there must be a specified need to use several things in a common way.
You do have two protocols that use a base protocol the same so those two together might use a helper class to facilitate processing. But that doesn't mean they implementating for each is represented as common entity.
|
|
|
|
|
I need to write a C# 2010 windows service that calls a console application at different times. Since I have not written a windows service before, can you tell me the following:
1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it?
2. How to you include a timer in the application so it executes at specified time periods?
Can you tell me and/or point me to references that will answer these questions listed above for me
|
|
|
|
|
sc steinhayse wrote: 1. How do you setup a windows service initally? Is it a windows service a
desktop application, console application, or what kind of an application is
it?
File > New > Project > Visual C# > Windows > Windows Service
sc steinhayse wrote: 2. How to you include a timer in the application so it executes at specified
time periods?
Create a new class and instantiate it from the OnStart method (you'll find this created by default, just search for it). The new class will contain whatever logic you need.
|
|
|
|
|
Do I need to setup a deployment package at the same time I setup the code proejct intitally?
|
|
|
|
|
No, you can add it later. Don't get too used to the Setup and Deployment project in Visual Studio. It no longer exists in VS2012 as it's been replaced by InstallShield LE.
Typically, setup projects are built and designed right along side the project it's going to be installing.
|
|
|
|
|
sc steinhayse wrote: I need to write a C# 2010 windows service
Why? Explain me what you need to do that cannot be done from a console-app.
sc steinhayse wrote: 1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it?
There's my argumentation that you do not need a service
A Windows-service is an application that runs without any user-interaction, and which runs before any users logs in. They usually run under a limited user-profile, and not the users' profile.
sc steinhayse wrote: 2. How to you include a timer in the application so it executes at specified time periods?
Yes, but you don't want to. Use the Windows Task Scheduler[^]; it's there to run a specific task at a specific time/interval.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
i posted today my first question, but how can if find the answer or look if i got an answer?
thanks ..
|
|
|
|
|
You'll receive a mail, just as you receive a mail for each reply on the forum. This is the C#-forum BTW, meant for C#-related questions.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Rule 1: Be patient, the people who provide answers are all volunteers who do this in their own time at no cost to you.
Rule 2: See rule 1.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
If you don't know how to the answers to the other question, how do you expect to get the answers to this one? 
|
|
|
|
|
Klaus, I appreciate that you are new to asking/answering questions here on Code Project, and that you aren't aware of the forum etiquette so I'll try and point you in the right direction.
First of all, if you have a question about the way the site operates, you need to post in the Site Bugs/Suggestions[^] forum.
When you ask a question in the forums, as long as you have "E-mail me if someone replies to this message" checked, you will be sent a reply whenever anyone actually posts a response.
When I checked your profile, it showed that you had only allowed 12 minutes from posting your question to posting this question. Be patient.
Speaking of profile[^], that's where you find links to your activity; so if you want to get back to your question, just follow the appropriate[^] link.
I hope that this is enough to get you started with Code Project.
|
|
|
|
|
how can i generate password protracted PDFs by crystal report
|
|
|
|
|
Dunno.
Doesn't CR come with a large manual?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Since you're asking this question in the C# forum, I'm assuming that you're referring to Crystal Reports that is shipped with Visual Studio and that you're using CrystalReportViewer control to export your report to PDF. If that is the case, the plain asnwer is that CrystalReportViewer control does not support password protecting PDF while exporting.
|
|
|
|
|
how can i generate password protracted PDFs by crystal report??/
|
|
|
|
|
I would like to know how to accomplish the following goals in C#:
1. In an existing C# 2008 application, I would like to create two separate log files.
a. The first log file would write out data in a fixed file format prferably to a text file. A new C# 2010 desktop and/or console application would be written to read this file and do furher processing.
b. The second log file would be written to display any messages generated by the console application and/or messages that are generated by a web service the console application calls.
Can you show me how to create these two log files?
2. A new C# 2010 desktop and/or console application will be written to process the information contained with the log file produced in a fixed file format in step 1a. listed above.
Can you show me how to read the log file that is in a text file fixed format?
Can you tell if the log file generated in a fixed file format should be generated in another format besides text? If so, what format should be used and can you tell me how to read the data in this alternative file format?
|
|
|
|
|
sc steinhayse wrote: Can you tell if the log file generated in a fixed file format should be generated in another format besides text?
No, plain old text format will be sufficient.
sc steinhayse wrote: Can you show me how to read the log file that is in a text file fixed format?
A google search on basic file I/O in C# would be a good starting place.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
You can use Log4Net to generate a log for an application. Go through their documentation to figure out how to use it.
|
|
|
|
|
Hello everyone,
I need to write a method in C# that can be called from VBA using COM. The primitive types can be directly passed to the method and returned from it, but what about the complex types? For instance, the C# List<> will have to be converted in a VB Collection.
Thanks, in advance,
Mark
|
|
|
|