|
Besides what Johnny said, you'll also need to implement an Installer class that uses the ServiceInstaller and the ServiceProcessInstaller . If you use the VS.NET designer to create this, they should already be there. Just tweak the properties to get what you want (like a display name and under which credentials to run it). If you didn't use VS.NET to create this (using the Add->Windows Service method), you'll need to create these yourself, but it isn't hard. See the documentation for these two classes for examples.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I like to serialize user entries to an xml-file. Therefore i ceated a xml-serializable class.
Cause I have to deal with more than one user I have to store different user entries.
Therefore I want to "collect" all user's entries in the same xml-file.
Then that i can navigate through my single xml-file and fetch all informations applying to the current user.
I haven't found an answer yet. Is it possible at all? Or have i to serialize "manually", meaning append nodes and elements by the xml-document-methods to the xml-file?
I hope i could figure out my problem understandingly.
|
|
|
|
|
Serialize to a MemoryStream , then get the child nodes of the document element and append them to the document element of your existing file.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I've been all over the MSDN library looking for a list of all the available built-in attributes and what thay do. I found a bunch of stuff about what they are and how to make my own but very little about the pre-defined ones.
Anybody know where to look?
Thanks,
Ken Galer
Electrical Engineer
Preferred Utilities Corp.
Danbury, CT 06810
|
|
|
|
|
Look at the documentation for the System.Attribute class. It has a Derived Classes link that gives all the direct derivitives, which you can then recurse into and find their derivitives, and so on.
As far as component development goes, a lot of useful attributes (probably the majority of the attributes you would use when creating a control library) are in the System.ComponentModel namespace.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Found it! Thank you.
In fact, I was there at one time and didn't reconize it.
Ken
Ken Galer
Electrical Engineer
Preferred Utilities Corp.
Danbury, CT 06810
|
|
|
|
|
First of all, hi to everybody, it´s my first post And sorry for my english I am from Spain.
Well I am making a little app that write questions with their answers into an xml file. I am using a treeview to display the data.
The question is the top node, and in it there are subnodes each for an answer.
I know how to see which node was selected with this code:
<br />
if(this.IsNode(tree.GetNodeAt(this.tree.PointToClient(Cursor.Position)))==true)<br />
Where IsNode is:
<br />
private bool IsNode(TreeNode node)<br />
{<br />
try<br />
{<br />
string foo = node.Text;<br />
return true;<br />
}<br />
catch<br />
{<br />
return false;<br />
}<br />
}<br />
My question is:
How can I see if an subnode is selected or an node? I want to show an menu for answers and another for question.
Thanks a lot
|
|
|
|
|
You are doing it the hard way.
There is an easier way to get what you want, by using the TreeView.SelectedNode [^] property. This property returns the currently selected TreeNode , or null if no node is selected.
Now you can test whether the returned TreeNode is a subnode. Remember that a root node doesn't have a Parent node, so we test that:
public bool IsSubnodeSelected()
{
TreeNode selected = MyTreeView.SelectedNode;
if (selected != null)
{
if (selected.Parent != null)
return true;
}
return false;
}
The above method would return true if a subnode is selected, and false when a rootnode or no node is selected.
- Daniël Pelsmaeker
|
|
|
|
|
Thanks a lot, it works but SelectedNode doesn´t work with right click so I use:
<br />
private bool IsSubNode()<br />
{<br />
TreeNode selected =treeview.GetNodeAt(this.treeview.PointToClient(Cursor.Position));<br />
if (selected != null) <br />
{<br />
if (selected.Parent != null)<br />
return true;<br />
}<br />
return false;<br />
}<br />
GetNoteAt with Current Mouse Position works with right click, now subnode works, and I can follow with my little app, thank you
|
|
|
|
|
hi i need any function helping me to create new dial-up connection on pc
|
|
|
|
|
Do you mean a new connection that they can choose from the auto-dial screen, or just a connection to their ISP? For the latter, see the WinINet[^] documentation.
For the former, this really seems to be platform-dependent, i.e. Windows XP works a little differently from Win2K, which works a lot differently from Windows OS's like 98 and ME. If you use the information above, specify functions like InternetAutodial , the user could create their own connection. If you need to create it for them (like some ISP do with their auto-configuration), I think you can do this with .cnf files.
One more way is to use the function InternetDial , which allows you to specify a connection name, flags, and a number to dial. This way, at least, you could get them to dial a particular server. An HWND the parent window (Form.Handle , inherited from Control.Handle ) is required for the prompt dialog. This is supported in all Windows platforms that support .NET.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
hello,
how can I send parameters to a designed page ( smart doc )?
thanx
anat
|
|
|
|
|
Hello,
I want to create an option dialog like Microsoft visual C# .Net option dialog
which consists of a tree in left panel and a by clicking on its node
left panel changes.
Is there any template or sample code that I can use it.
Thanks & Regards
Saeideh
|
|
|
|
|
I would create a form, then put a TreeView on it. Set it's Dock property to Left . Then create multiple Panel objects with different names (or create them in your form code in an array). Then, when a specific TreeNode is selected (check in the Click event), you show a specific Panel, and hide the others. You may want to set the Panel 's Dock property to Full .
- Daniël Pelsmaeker
|
|
|
|
|
You should also try searching CP for option dialogs. There are several examples that work the way you want.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi Guys!
we know that there is a way to handle custom exceptions in
asp dot net by specify the error page.
is there any way to do the same in csharp windows form.
i.e custom windows form.
i don't want to write try/catch block in my programm
in all places.i just want to write it once where it can handle all the program exception. is there a way.
Ali Khan
|
|
|
|
|
Legend Never Dies wrote:
is there any way to do the same in csharp windows form.
No. You can't get exceptions without try/catch,I think the best you can do is use try/catch and popup your custom error form in catch part.
Mazy
No sig. available now.
|
|
|
|
|
No u don't understand my question,
i want to write only one try/catch block that can handle all the exceptions of the whole applications, which off-course may contains multiple windows forms
|
|
|
|
|
Handle the HttpApplication.Error event in your Global.asax file, or it's related code-behind file. Since auto-event-writeup is enabled by default, you can just declare your handler as
private void Application_Error(object sender, EventArgs e)
{
HttpServerUtility server = HttpContext.Current.Server
Exception e = server.GetLastError();
} For more information, see the documentation for the event I mentioned, and the HttpServerUtility.GetLastError method.
You could also create your own IHttpModule for handling, errors, too, if you require library portability without moving the whole web application.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
There are some buttons in yahoo and hotmail that have fletcher at the left or right of them and when you click on them drop down menu appear and you choose an option. I need them in my windows applicaation in C#.Does anybody know them? I don't have time to develop them myself.
Mazy
No sig. available now.
|
|
|
|
|
You might get an idè by studding the source code for
http://www.codeproject.com/cs/miscctrl/color_picker.asp?target=color%7Cpicker
Thomas
|
|
|
|
|
Hi,
I was just wondering...
how do you make a stand-alone program in Visual C#.net 2003 that can be used by people who do not own visual studio, or any programming language for that matter.
Currently it says that they're missing MSCOREE.dll, and I suspect they're missing about 40 other dlls as well.
Any ideas?
Thanks
|
|
|
|
|
Hi,
The user that executes the program, gotta have the dotNet 1.1 Framework.. =)
..?
// Up The Irons, SirErugor
|
|
|
|
|
It's called the dot net framework. You kind of have to install it on the client computer.
|
|
|
|
|
I already said tha'
// - Up The Irons, SirErugor
|
|
|
|