|
1. Create a share on the target system, and use two FileStreams (one for a file on the local system, the other for a file on the target system) to copy the data over.
2. Use sockets and have a sending application on the source system and a receiving application on the target system. Obviously the target app has to be installed and running before this will work.
3. Use .NET Remoting instead of sockets. Again the target app needs to be installed in the target system.
I'm sure that there are other ways, but that'll get you started.
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
I'm currently learning C# and Visual Studio and have run into this problem.
I'm reading Petzold's "Programming Windows with C#" and am working with two classes, both of which have Main() methods.
The second class, CsDateInheritance, is an inherited class of the first, CsDateConstuctors, and I want the program to use the Main() method of the second class, CsDateInheritance.
If using a DOS command line, the program can be complied as such:
<br />
C:\(rootfolder)>csc CsDateInheritance.cs CsDateConstructors.cs /main:CsDateInheritance <br />
<br />
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4 <br />
for Microsoft (R) .NET Framework version 1.1.4322 <br />
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved. <br />
<br />
C:\(rootfolder)> CsDateInheritance.exe <br />
Birthday = 21 Aug 1981 <br />
Today = 24 Aug 2003 <br />
Days since birthday = 8038 <br />
<br />
C:\(rootfolder)>_<br />
Program works perfectly.
Though, I want to be able to run/debug this program in Visual Studio .NET 2003. I'm using the C# Standard Edition.
I have the first class file inserted into the solution as a linked file.
When I compile in VS .NET, I get a "this program has more than one entry point defined" error. How can I fix this in VS .NET, without having to compile from the command line?
I have found that I can set the Main() method of CsDateConstructors "IsShared" value to false, and I get a clean build. Though, this sets the class to basically be "Inheritable" only, and not stand alone.
Anyone know the trick? All help/suggestions welcome.
Joe
realmrat@msn.com
|
|
|
|
|
Problem solved. Thanks to ericgu @ experts-exchange
You can set this in the project properties.
Look for the "startup object" setting, and enter the name of the class that the Main() method is in.
Joe
realmrat@msn.com
|
|
|
|
|
I'd be pleased if somebody could help me on these:
1. OnStart() event get a string[] argument. From where I can send these argument to the service,the service start on start up,so what are these commands for?
2. Some services only run when admin logged in, how can I do it too?
Mazy
No sig. available now.
|
|
|
|
|
1. The string[] contains arguments passed from the command line. If the service starts automatically or is started by teh control manager, there are no arguments. But you can enter commands like "start [service_name] -install".
2. Alter the service, or become an admin
Which srvice do you want to start?
|
|
|
|
|
Thanks for your reply.
Corinna John wrote:
Which srvice do you want to start?
I don't want anything with standard services.I want my service only run when admin login.Just curious to know how to do it.
Corinna John wrote:
But you can enter commands like "start [service_name] -install".
But where is its argumennt.It install the service,ya?
Mazy
No sig. available now.
|
|
|
|
|
1. You can check in the OnStart-Method, whether the active user is in the Administrators-group (start) or not (cancel).
2. -install is only one possible argument. You can pass all arguments you like, if you start your service using the start command instead of the service control manager.
|
|
|
|
|
Well, thank you Corinna. Just one more question. How can I stop service programically inside the service.I know I can do it with ServiceController but is it the way you do inside service too or not?
Thanks
Mazy
No sig. available now.
|
|
|
|
|
You couldt throw an exception in OnStart, but this is not a very clean way.
I haven't tried yet, but
ServiceController sc = new ServiceController(serviceName);
sc.Stop(); sc.Close();
shouldt work from inside the service.
|
|
|
|
|
I'm trying to figure out how to read in an excel file then put some extra values in the spreadsheet. The problem I have (I looked up in the msdn and they gave me "Driver={Microsoft Excel Driver (*.xls)};DBQ=Excel test.xls" for a connect string. The problem is when I run it it tells me I need to put a Provider= in it. That would be great if I could find the string for the provider. I'm working with Office 2000 and office xp.
another question is would Crystal Reports be better to use? I'm not doing any major manipulation of the spreedsheets I'm just reading them in to find where to put the data so I don't overwrite anything and then inserting some rows and colums.
Thanks for the help.
|
|
|
|
|
Is it possible to insert a WinForm in a WebForm?
I'd like for example to insert a managed directx viewer in a webform,
that would display 3d graphics on the form?
Is this possible?
Regards,
Z.
|
|
|
|
|
|
leppie wrote:
hosting the Runtime in IE
I thought IE already does that .. ?
Is this the same as the gotdotnet workspace source control(it looks / behaves similar to an embedded activex control), another doubt is how does this differ from href exes (like chris sells Wahoo! which pops as a separate app)
thanks,
Kannan
|
|
|
|
|
Kannan Kalyanaraman wrote:
I thought IE already does that .. ?
Not without intervention. There is a huge section in MSDN.
leppie::AllocCPArticle("Zee blog");
|
|
|
|
|
I have program like this:
private void pictureBox1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
pictureBox2 = new PictureBox();
Bitmap img = (Bitmap)Bitmap.FromStream(this.GetType
().Assembly.GetManifestResourceStream("Program.kolko.bmp" ) );
this.Controls.AddRange(new System.Windows.Forms.Control[] {this.pictureBox2});
pictureBox2.Image = img;
pictureBox2.Location = new System.Drawing.Point(e.X, e.Y);
pictureBox2.Size = new System.Drawing.Size(28, 28);
pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
pictureBox2.TabIndex = 1;
pictureBox2.TabStop = false;
}
I want to add a button to my Form, that OnClick will delete all instances of PictureBox2 from Form (will clear my form from Pictureboxes). I don't know how do it.
|
|
|
|
|
1. Search this.Controls for PictureBoxes objects (on types, names, images etc. properties) in for loop and delete them.
2. Create ArrayList (like Controls) and store PictureBoxes into it while creating them and next delete all (without searching) in button OnClick().
Zdrufko,
AW
|
|
|
|
|
Dziekuje bardzo za pomoc panu
|
|
|
|
|
|
|
Hey Leppie,
How are you going with that MSIL addin for #D?
Cheers,
Erick
|
|
|
|
|
Erick Sgarbi wrote:
How are you going with that MSIL addin for #D?
I'm thinking of doing a generic Babel Service instead, when I get around to it. Unfortunately the street lites dim when starting #dev.
Have a look on my blog for a screenie of a heavily modified #dev text control for IL.
CHeers
leppie::AllocCPArticle("Zee blog");
|
|
|
|
|
Quite a bit has been fixed, and quite a bit has been added. I'm going through my bug list and removing just about everything there.
New Features:
* Menu designer
* Custom and "user" control support
* C# to VB Converter (not much use for this, though)
* Greatly improved parser (means less 'code-chewing')
* Enhanced Find-And-Replace
* Improved properties window (control dropdown, ability to choose from existing methods for an event
* Improved Assembly Scout
* Improved Project Scout
* Faster loading
* Before and After Build scripts added
* Tooltips in task pane
* File reload (Ctrl+U) prompts for reload
* Sidebar configuration dialog
* Property grid context menu
* Other minor things like Word Count
* uses less resources. (I use Windows 98, and believe me, if something starts using less resources, I notice.)
Now what they need to do is stop using the Crownwood Magic Library for their controls. That's the slowest, most buggy library invented. They are wanting to do this, and they'll go with the FLUID toolbar if we can get that done on time.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
The texteditor component is by far the biggest hog. And are IMHO very alpha still. There are hundreds of improvements needed there. I had to do quite a bit when I played with it for my "attempted" IL editor (VSIP seems the better choice now though). Have a look here http://leppie.blogspot.com[^]
leppie::AllocCPArticle("Zee blog");
|
|
|
|
|
leppie wrote:
The texteditor component is by far the biggest hog.
I'd have to agree. It's both a memory- and resource-hog. Incidentally, in Windows 98, if you have less than about 45% GDI resources, it doesn't repaint - it gives an error because the bitmap can't be created.
If you manage to do major improvements, you might want to help to get them integrated back into SharpDevelop.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I have to say that the the codebase was well designed, but not well coded. Basically someone needs to get in there and clean up the mess.
jdunlap wrote:
If you manage to do major improvements
I have suggested things but neither of them appear to be implemented. Actually one is a coding error with respect to font quality. They override it with there own setting (instead of leaving it to Default), and as you can see the text looks @#$@ especially using Lucinda Console. Also they are creating too many GDI resources instead of reusing existing resources. Line quality is also not very good.
leppie::AllocCPArticle("Zee blog");
|
|
|
|