|
George_George wrote: If there is a constructor is base class without any parameters, it should be the default constructor, correct?
Yes
George_George wrote: BTW: how to define a constructor to be default one if I have a couple of overloaded constructors?
You can't. There's no default constructor in this case, you have to call one yourself.
The parameterless constructor should still be the default one though.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks Greeeg,
How could I know which constructor is the default constructor?
regards,
George
|
|
|
|
|
Take a look at this link[^].
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
So, no matter the system provided constructor or the user provided constructor, if the constructor has no parameters, it could both be called default constructor?
regards,
George
|
|
|
|
|
Yes. Why don't you write a simple app and test this yourself?
|
|
|
|
|
I would like to write a Windows service in C#, but I have a few doubts that I would like to clarify.
Given the user having Administrator rights, is there a way to prevent the user from killing the Windows service process from command-line or task manager? If such an attempt was made (killing the Windows service process), can I write a prompt dialog to have the user input some sort of password before it shuts down?
Thanks.
|
|
|
|
|
If the user has admin rights, they can modify the status of any running service.
Zerox MXI wrote: can I write a prompt dialog to have the user input some sort of password before it shuts down?
Services don't have a user interface. You'd probably have to write a system tray application that provides the interface, and the user then has to use that application to stop the service. In order to force this, you'd have to write your service so that it can only be stopped via the system tray application.
All this is totally outside the realm of "standard practice", so consider carefully before you do this.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi Guy's
I do not post often, google serves me well.
I cannot find the language though to search for the answer to my current dilema. Please help.
I want to ftp a file which is still being created. The file may take 10 to 15 mins to make. I would like it to arrive at it's destination as soon as it is completed.
I only work in c#. Can it be done. can ftp be throtled to stay in pace with the creation process?
thank you all in advance.
seems arrogant to assume folks will read such things. but thank you anyway.
J.
|
|
|
|
|
ltheonel wrote: I want to ftp a file which is still being created. The file may take 10 to 15 mins to make. I would like it to arrive at it's destination as soon as it is completed.
Do you want to download that file after it is created fully?
If you know the file size before, you can get the remote file's size, compare it with the expected size. If it matches, consider the file creation is complete.
Please correct me if I got your question wrong.
|
|
|
|
|
Hi, Thanks for responding.
Sorry I was a little vague.
My process at the moment is thus:
I am creating the file myself locally and when it is finished I then sent to remote
I cannont know the size of the file beforehand but I do know when I am finished creating it.
My problem is two fold:
1. How to access a file which is currently being written too. (the file I am creating)
2. How to control the speed at which I upload the file so that I can match the pace of the creation process.
|
|
|
|
|
Yes. You can do this. I have done this last early last year. I created a tiny text editor that would upload my web pages AS I WAS CREATING THEM. I acheived this by using the TextChanged Event of the TextBox control. Then I added code to the TextChanged event handler that would save the text inside TextBox control to a string. Then, I uploaded the text inside the string to my ftp sever. By doing this, everytime the TextBox control is "changed" it would save to string and upload. Save to string and upload.
So, in short:
Create TextChanged Event Handler for TextBoxControl (or whatever input control you're using)
Add the code that will save the controls text to a string
Upload string's text to server (make sure you use Append. Instead of Write.)
Hope this helps. There's alot of code involved in this (hence the reason I didn't post it here)...
jt.
p.s. let me know how it goes...
|
|
|
|
|
Thank you for your response.
I got a solution. though I am having buffer starvation issues!!
I instigate the file creation from a third party application. It takes a variable time to create the file I want to transfer via FTP.
I was chewing too big a problem, and of course once I reduced it. the solution was easy.
A lower level call to open a file as shared read on a thread I can sleep. (I have problems with this approach as my reader thinks the file writing is complested when thats not true)
but upto about 20mins I am good.
at any rate the bytes I read I feed to a queue for the FTP process and all works well till my file reader thinks the file is ended.
I will solve this shortly if you are interested, I will post the solution.
if not
Thx for your responses.
J.
|
|
|
|
|
Nice work, J. I am very interested to see how things go
j.t.
|
|
|
|
|
Cool, now that I've got the basics nailed. I'm off to work on the server core which uses remoting, so it'll be a couple of weeks no doubt
j.
- Why does everything you want to do require you to learn one more thing?!!!
|
|
|
|
|
Hello!
If I have a XML File which is at first a serialization of a class done by application A, is there a way to create in application B, which does not know how the class should look like, a class with the correct structure just by this xml file?
e.g:
Aplication a:
[Serializeable]
class A1
{
prop string s1 {get;set;}
prop int i1 {get; set;}
}
{
A1 a1 =new A1(){a1="test", i1=1};
XmlSerializer xser = new XmlSerializer(typeof(a1.GetType());
StreamWriter writer = new StreamWriter(...);
xser.Serialize(writer);
}
Now I have the xml file.
Application b:
{//MainThread
TODO: Desirialize the xml file
without knowing class A1 from application a
Or maybe this can be done by creating an xsd file first (and if so how this can be done?)?
|
|
|
|
|
ezazazel wrote: is there a way to create in application B, which does not know how the class should look like
How about both classes implement a common interface? After deserializing, you can cast that object to this interface instance.
|
|
|
|
|
This doesn't help me, because the application which creates the xml file is not made by me.
So I get the huge serialized xml file and now should do something with it.
|
|
|
|
|
I have tried to find some information on the internet but can't seem to find any tutorials on this.
Basically when someone install's my application I will have it check when they run the application to see if there is a update available. If there is a update available it will download and run the new MSI file. (This is all done).
The problem I am having is when you run the new MSI file, I can not get it to actually upgrade the program. I have changed the Version number from 3.0 to 4.0 in the setup file and then select yes to update the ProductCode since I changed the version number. I have RemovePreviousVersions set at True and DetectNewerInstalledVersion to True.
Am I missing anything or does someone know of a article that describes how to do this?
|
|
|
|
|
Hi,
I'm working with PowerPoint Object Library 12
and I need to check if a file with a "ppt" suffix was created in PP 2003.
The "ppt" itself is not enough to know what I need,
because it is possible that the file was created in PP 2007 and saved as PP 2003 with a PPT suffix.
Thanks,
Ophir
|
|
|
|
|
|
Thank you for the reply!
Any idea how do I get this magic number form a ppt file?
I opened the ppt file in notepad to have a look if there is anything obvious in the beginning of the file, but no luck there.
Thanks
|
|
|
|
|
Voting 1 for a message that helps you will not encourage cp members to help you.
|
|
|
|
|
Sorry,
I'm new to the group.
I Clicked 1 by mistake and then clicked 5 to fix it.
Thanks
|
|
|
|
|
ophirmi wrote: and then clicked 5 to fix it.
Perhaps you didn't as the rating is still 1.
As for powerpoint files, I am not sure if they have magic numbers. You can create several files and see if they have some common header or use google to find information about it.
|
|
|
|
|
Hi all
I have a Parent form with a calendar and a child form with a schedule on it. When i double click on a date it will show me the schedule from inside the parent form. i want it create a tab in the parent form whenever it opens.
Please help
|
|
|
|