|
Won't string.Split(Environment.NewLine) do what you want ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You don't want Split at all because it removes the delimiter from the results and you'd need to add it back on.
You'll want to write your own version of Split that doesn't remove the delimiter.
Or wait for Microsoft to add another value to System.StringSplitOptions that causes Split to work the way you want.
|
|
|
|
|
Hi all,
I've come across an interesting problem that I'm not really sure how to get around.
I have a custom user control I designed to edit certain properties of a document, similar to the VS2005 properties area. Sometimes input needs to be validated before the user leaves a textbox, so what I did was I added an event handler to the Validate event on the individual items.
Here is my problem: the Validate event doesn't fire if you click on anything in the GUI that has "CanFocus=false." So, none of the menu strips, toolstrips, etc. cause the Validate event to fire. Neither does the Leave event or the LostFocus event.
I want it to behave the same way as the VS2005 properties window - if you are in the middle of editing a property and you click on a toolstrip button or a menustrip item, it will cancel the click and give you a validation error message. Is there any way to do this besides, say, adding a Click event handler to every control in the GUI and telling it to unfocus the property being edited?
Thanks in advance!
|
|
|
|
|
Hi there,
can a service written using C# to open(run) another application written using C# too,
In other word I wrote a service which I need to open forms and do more , so I had a windows application to perform all what all I want, but I do not know how can I call it from the service !
I hope I made my self clear and described the problem well ,
please urgent help is needed
Thanks
There is always something to learn
|
|
|
|
|
You won't see any interface if you have a service open an application. Services run on system accounts, not on user accounts, so the user would never see the open application.
If you want to control the service from a form, you can create a seperate application that configures a settings file and then restarts the service when you are finished.
If you need the application and the service to communicate in real time and relay information, then you will need to use .NET remoting or TCP for communication, or some other form of exchanging data between apps.
|
|
|
|
|
I am not sure it may be helpful for you or not. But from windows services we can open process like "notepad", write on files etc. but not fully interact with desktop.
|
|
|
|
|
A service is unlikely to be the right tool.
What is the goal?
|
|
|
|
|
the goal is that : I need the service to update a Data Base or read from it before the user log on his windows account , and then when he log on the service opens an application for him,
if the service is unlikely to be the right tool , what else can be ?
is there a way to run an application before the user log on windows, then it continues run ?
There is always something to learn
|
|
|
|
|
Just make it two seperate parts...a service that updates the database, and an application that has a shortcut in the "startup" folder so it starts automatically on login. If you need to, you can have the application notify the service when it closes, that way it will know know the user logs off as well. But, like I said, you can't have the service open an application directly, because it is running on the "system" account.
|
|
|
|
|
A Service would be running continuously whether a user is logged in or not, is that what you want?
You may want to use a Scheduled Task that executes when the user logs in.
To have an app run when the user logs in, use the Startup folder, but first be sure the user wants it to.
|
|
|
|
|
hii,
Im developing an client server application in C#.
In that i have to use Mobile Agent technology.
On the Server side there is a class...which i want send to the client...by System.IO class..let the class be Mobile...and it has a methode mobilecode()
public class Mobile()
{
public void mobilecode()
{
Code for gathering data from client.
}
}
On the Client side i read this file by stream reader...and i save this class in the same directory of the client.cs project..
on main function of client.cs
i call the class by...
Mobile.mobilecode();
but while compiling..it gives the error...
Mobile doesnt exist...
even if i make an empty class Mobile...thinking it could b overwritten by the code sent from server...dat does not happen...on runtime it reads the same old file...and not the does not updates till the code is executed.
So can anyone help me ou here...as to how to send a class file 4m server to client at runtime and access it immediately at runtime...!!
any help wud b appreciated...
Thnx in advance,,,,!!
|
|
|
|
|
You can't do that - the compiled program is exactly that - compiled. You can't just copy a .cs file beside the .exe file and expect it to read the .cs file.
Client-Server communication is usually handled in a completely different manner then what you are trying to do. You can look at this for a starting point:
http://www.codeproject.com/KB/IP/BasicTcpServer.aspx[^]
Exchanging actual class source code between client and server applications would require using dynamic compilation and reflection, which is probably way beyond the scope of what you are trying to do.
|
|
|
|
|
hey..
thx 4 d info..
thn is it possible to implement mobile agents in C#?..if yes how?
|
|
|
|
|
That depends on the complexity of the mobile agent you are creating.
If you need it to execute arbitrary code, then you will need to use dynamic compilation/reflection.
If you can replicate the entire program at each station and you only need to move its current state, then just copy over a configuration file instead of a .cs file, which allow the next station to load itself into the previous stations state and continue.
|
|
|
|
|
Hi my names Joe,
Im a newbie and I need to find out the best way to let a user be able to retrieve a list of files from a database, then obviously add a new path to a file.
The files are pdf, i need to know which control would be best to use to retrieve info from a database and then be able to edit and brwose to a directory and select a new file to be added. this info in turn will be terieved by our intranet which will display the pdf.
Donno if anyone might want to help.
Thanks
J
|
|
|
|
|
KornJoe wrote: then obviously add a new path to a file.
Not sure what this means ? Add a path to what file ?
KornJoe wrote: i need to know which control would be best to use to retrieve info from a database
No control should be used to do this, you should write code to get data from your database.
KornJoe wrote: then be able to edit and brwose to a directory
If you want a list of items to edit, a datagrid or grid view is fine. IF you want to browse for folders, you can use a FolderBrowseDialog to do this, and get back the folder path.
KornJoe wrote: this info in turn will be terieved by our intranet which will display the pdf.
If you want to change the contents of PDFs, you will need to use a third party library. No PDF support is built in.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hii,
i am developing a client server application in C#..
In this multiple clients can connect 2 server. I am using a set of 4 servers so that the fault tolerance can be increased in case a server is down..its load can be shared by another server i.e. i am developing a distributed application.
now i want to know how these client requests can be distributed across the set of servers.
i mean suppose i want server should handle 25 clients at max...
if 26th client tries 2 connect to it it should redirect the clients to the another server whch is available...and if all servers are busy then display a message all servers busy..
so can u give me the code as to how load balancing can be done among multiple servers.
any help would be appreciated.thanks in advance
ankita luniya
|
|
|
|
|
I would expect you'd set up communication from the server that users connect to, to the other servers, and they would keep track of how many connections there are, so that you can distribute them as you go, so it's 2/2/2/2, not 8/0/0/0. Also, I wouldn't expect you to create an arbitrary cutoff, who is to say if 26/26/26/26 would not work just fine ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yaa...d arbitrary cut off thing is ok...26 ws jus an example...can u exemplify wht u saud wid an example....??
|
|
|
|
|
Hi,
Is it Possible to use RMI(Java Concept) like concept in .Net?
If Yes-How can we used?
If No-Then other solution for that will be?
Thanks
|
|
|
|
|
|
I'd like to drag metafile from my C# application and drop it in Word, Excel or Visio.
Metafile metafile = new Metafile("meta.emf"); <br />
DataObject data = new DataObject(DataFormats.EnhancedMetafile, metafile); <br />
DoDragDrop(data, DragDropEffects.Move);
I found, that .NET uses new format of the clipboard so older applications cant recognize the dragged .NET metafile.
In this article http://support.microsoft.com/kb/323530[^] is a guide to copy the .NET metafile to the clipboard, so I can paste it later to Word.
But how can I DragDrop this metafile directly to Word ?
|
|
|
|
|
Hey All,
I need help with this urgently, and any would be much appreciated...
I have a CAB file that gets downloaded from a site to a pocket pc or smartphone...
I need to have data attached to it somehow, just a line of text or something, either
in some seperate file or somehow...
This is because I need to have a changing "serial code" to go out with each download of the CAB...
Thanx a million in advance!
|
|
|
|
|
There are libraries that can open cab files, but another solution is to generate your license codes seperately and design your app so each code is verified online and only works on one machine.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanx alot for you advice and swift reply Christian!
you rock...
Seems like these would be the only ways, could you direct
me to any of these libraries? and I hope the lib wouldnt
require me to rebuild my application... thanx again!
|
|
|
|