|
Deborah Palmer McCain wrote: Should this be simple deduction and logical? Pretty much always in IT
To work this through, a basic [incomplete] definition of a few keywords is probably helpful:
abstract : Whatever is declared abstract is missing or incomplete. A the class level this means that the class can't be instantiated directly, so it must be subclassed before use. For members of the class marked abstract you don't declare a body (e.g. <codelang="cs">public abstract int f();), and you must override in a subclass unless the subclass is also abstract . All abstract members are inherently virtual
virtual This isn't in the example, but it marks a method as being overridable, that is subclasses can (as opposed to must) override them in a non-abstract subclass.
override Members marked as overridden "replace" the superclass's virtual /abstract method. This can be summed up with the following code:
public abstract class Foo
{
public abstract void Bar();
}
public abstract class Baz : Foo
{
public virtual void Quux()
{
}
public virtual void Grault()
{
}
}
public class Corge : Foo
{
public override void Bar()
{
}
public override void Quux()
{
}
}
Now to your problem. "No method to override", the word override only appears once, so we know this line is the problem:
public override int f()
{
...
}
So what are the preconditions for overriding? The method must override a method in a superclass that is marked as abstract or virtual . The method apparently being overridden is marked as abstract . It put italics on "apparently" as, in reality, MyClass2 doesn't have a superclass (as PiebaldConsultant has replied):
abstract public class MyClass2
the fix is now easy:
abstract public class MyClass2: MyClass1
|
|
|
|
|
Thank you for your detailed explanation of the issue. It helped alot, and even though the issue was resolved, your detailed assistance is appreciated.
|
|
|
|
|
Well you have copied the sample code from here[^] which has been specifically written to generate a CS0115 error. What other result were you expecting to get?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Haha that's a good one 5/5
|
|
|
|
|
I plead ignorance (which is becoming less easy). There is now an arc in my learning curve.
|
|
|
|
|
I usually plead senility, it works every time.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
hello every boday
I want help to make my chat software worked over internet untill now it is run in LAN if any one have any idea please help and thanks
|
|
|
|
|
Does this help?[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Have you really been at this for over a year[^]?
|
|
|
|
|
waw oh my god yes Iam but until now Imaked in LAN not WAN
|
|
|
|
|
If it works on a LAN then (unless it is using UDP broadcasting/multicasting) the software is fine, you just need to host it on an Internet-accessible server and set up the firewall appropriately.
|
|
|
|
|
but I didn't now how build and create Internet-accessible server
|
|
|
|
|
1. take computer
2. plug in cable to router
3. ????
4. profit
(Part 3 also includes setting up port forwarding, and your ISP agreement needs to include a fixed domain name or (ideally) IP.)
You can also use a hosting service or a cloud service like Amazon's that will give you public IPs.
If you don't know about this, you probably shouldn't be trying to create Internet applications, because it's odds on that you will make dumb security mistakes as well.
|
|
|
|
|
thanks for avadence and help mr:BobJanova
|
|
|
|
|
I have a web page that needs to generate a report for download on a hosted server. Because of the complexity of the long running report I was thinking it would be best to have this run as a service. My thought was that it would work like this:
1. User initiates request for report through web page which sends request to service or application.
2. Service or Application generates report on server in background.
3. Service or Application saves report as PDF.
4. Service or Application emails notification upon completion.
At any time during the process the user should be able to visit a processing page that gives them the status of the report generation.
With that said, does anyone have direction for me on what to do with this? I have never built a web service or an external application for something like this, but rather embedded all my reports within my application so I am a bit lost on where to begin.
While I realize that this is not strictly C#, it is going to be a C# item, not an ASP.NET page. Any help is good help.
Cheers, --EA
|
|
|
|
|
There are other issues such as
- Exactly how long does it take to run
- What about duplicate request
- What happens if there is an error while it is running.
Presumably you are also assuming that the email will always reach the target.
If it was me.
1. Create windows service.
2. Post the report request into the database as a 'task' - invalidate duplicates.
3. Service looks for new requests.
4. Service process new requests.
5. Service posts results, either report or failure reason back to database updating the 'task' (so it won't run again.
6. Post process - like send the email with results.
7. Go back to step 3.
There might be some clever way to embed the functionality in IIS.
|
|
|
|
|
It depends how long is 'long'. For fairly long but not ridiculously so (or that processor intensive), you can just start a new thread in your web app to handle a report (or, better, use a thread pool, BackgroundWorker or Task to manage resources for you). If you need to farm it out to a different process, perhaps on another computer, then personally I would manage the communication through a TCP connection between processes. I wouldn't put the report status in a database table as that data is transient (only relevant while a report is being constructed), unless you need to audit the report generation pipeline. You could also do it with pipes or WCF or DDE (yes it still works!) or any other form of inter-process communication you're familiar with, depending on your OS.
However you manage that part, you then need a page which spawns a new report processing unit (thread or process) or adds a report request to the queue of an existing one, a page which will look up the status of an existing report (so you need to give your reports queryable application-unique IDs) and some communication between the web app and the processing unit to maintain information about the status of outstanding reports.
|
|
|
|
|
I want to open a msg file from disk and perform a Reply action like normal mailitem and display it to user.
Currently i have a datagrid where i show list of msg files .When i right-click on the grid we have context menu for Reply/ReplyAll/Forward option. If a user clicks on any of these action i should be able to open the mailitem in reply/replyall/forward mode.
In Outlook when we click reply for a mailitem it displays the mailitem to user...the same way i want the msg file to be opened to user in reply mode.
Any help is greatly appreciated ...
|
|
|
|
|
Hi all,
I am creating the setup for my windows application,i want to include the expiry date for it that means whenever the setup is installed it should run for the 30 days after installation.
How can i do it ?
Is there any script in c# ?
Thanks in advance.
|
|
|
|
|
The way you could tackle this requires quite a bit of infrastructure you probably haven't got in place yet. Basically, when your application starts for the first time you would register it on a remote server (use a web service for this, and generate a unique ID for the app). Using this ID, every time the application is run, compare the expiry date with the current date at the remote server and return whether or not the application is run. The advantage of this approach is that it takes into account the user resetting their system clock trying to circumvent the time check.
|
|
|
|
|
Disadvantage for this strategy is that user must have a network connection which is always connected.
|
|
|
|
|
or at a site that blocks it (corporate firewalls etc)
|
|
|
|
|
Or they wireshark the "it's ok, run" response from the server, redirect the server domain to localhost, and then run the program forever using a fake server.
Or they'll just remove that check from the program, which is probably a lot simpler.
|
|
|
|
|
Or share the ID amongst several installations.
|
|
|
|
|