|
I guess he needs one step further. The requirement is to get an ArrayList, here's code snippet -
string sample = "apple,500,15.50,0000010105,good,A001";
string[] sp = sample.Split(',');
ArrayList arr = new ArrayList(sp);
foreach (object item in arr)
{
Console.WriteLine(item);
}
Hope this would help. 
|
|
|
|
|
Arindam Sinha wrote: ArrayList arr = new ArrayList(sp); foreach (object item in arr) { Console.WriteLine(item); }
no need for reassigning it in ArrList
we can use like this..
for(int i=0;i<sp.length-1;i++)
{
console.writeline(sp[i]);
}
<div="" class="ForumSig">Padmanabhan
My Articles:
Articles[^]
My latest Article:
Word Automation[^]
|
|
|
|
|
Yes I know. It was done only for the original request. He needs an ArrayList. 
|
|
|
|
|
Thank you very much friend
|
|
|
|
|
|
Hi!!
I'm doing a small application, but do not know how to get the path of a folder when click right this folder(as cut,copy of windows).
Help me. Thanks!!!
|
|
|
|
|
You have to give a little more detail. How are you listing the folders? Is it a listbox, treeview???
only two letters away from being an asset
|
|
|
|
|
Not sure what you mean. If you are copying from Windows Explorer, the clipboard would hold a description of what you copied/deleted in various formats.
Clipboard.GetFileDropList() or Clipboard.GetText() might fit your needs.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
When I add a new connection string in my .setting file it brings up a nice Connection Manager screen, which allows me to select the appropiate setting for my connection. I was just wondering if anyone knows how I could bring this screen up once my app has been installed at the client. To make it easier for him to select the connection string.
Thanks.
|
|
|
|
|
Your requirement is not clear to me.Why do you want your end user to put the the connection string?
In general, the end user should only install the application (I am assuming it's a desktop application). If you are working on a WebApp,then end user does not have that choice as the application would be in IIS server.
The screen that you get that's a feature of Visual Studio.
|
|
|
|
|
If you feel that you really must do this, although it credits your users with more smarts than the average, download the SQLServer2008/2005 samples from here[^].
In the programmability part there is a sample called ServerConnect which does a pretty good imitation of a Connection Manager.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i want to create a C# win app that allows the user to enter in a text box some data and press send..
the data in the text box will be sent to the web app (server side) and store this data in a text file on the web app.
thx!!
|
|
|
|
|
You should be using a database. The windows app would write to the database and the web app would read from it to display.
only two letters away from being an asset
|
|
|
|
|
you can use webservice to communicate with server.
Create new web site project , Add new item , WebService (Asmx) and it gives you an example method with [WebMethod] attribute. You can add parameter to it and rename as you wish, then go to your win app project right click the project item and click Add Web Reference (Vs2005) or Add Service Reference (Vs2008) then write your asmx file's address into the box then give a name for your local service client object. Press ok to close dialog.
Write these to make SOAP request :
YourObjectName obj = new YourObjectName();
obj.YourWebMethodName(parameters);
i hope, you find this useful.
My Personal Blog about Software Developing
|
|
|
|
|
do u have a simple project to do that work...cos i'm a bigener in that projects..
thx.
|
|
|
|
|
|
For a beginner don't you think this is a bit complicated? Connect both apps to a database, plenty of examples and easy for a beginner to understand
only two letters away from being an asset
|
|
|
|
|
Until race conditions come into play, and he has to use either IPC or mutexes to stop one application reading as the other is writing
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Computafreak wrote: Until race conditions come into play
Explain where and how this senerio would occur. Are you saying the database wouldn't be able to deal with concurrency issues? How would using a webserive or writing to a file lessen this risk?
only two letters away from being an asset
|
|
|
|
|
I've thought about it a little, and looked into it a bit more. You're right, race conditions don't seem to happen here. I got the roles backwards in my head. Sorry about that
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
My code is really basic using an Http channel to send a client activated object and it works fine when I run the client and the server from the same pc.. But when I try to run the server on one pc and the client on another, the client just shuts automatically. The 2 pcs are not connected in any way, but they both are using wifi.. and my code uses an http channel, so they can connect through the internet.. right? Do I need their IPs for them to find each other, or is the shared Http channel port enough? Sorry.. I'm a beginner.. any help would be amazing...
modified on Saturday, June 27, 2009 9:52 AM
|
|
|
|
|
Maybe you could post a piece of the code of client and server? Could be helpful...
|
|
|
|
|
My server is:
public static void Main()
{
HttpServerChannel channel = new HttpServerChannel(9000);
ChannelServices.RegisterChannel(channel,false);
WellKnownServiceTypeEntry remObj = new WellKnownServiceTypeEntry
(
typeof(ProcessActivator),
"ProcessActivator",
WellKnownObjectMode.SingleCall
);
RemotingConfiguration.RegisterWellKnownServiceType(remObj);
Console.WriteLine("Press [ENTER] to exit.");
Console.ReadLine();
}
My client has:
HttpClientChannel http_channel = new HttpClientChannel();
ChannelServices.RegisterChannel(http_channel,false);
IProcessActivator.IProcessActivator process_activator1 =
(IProcessActivator.IProcessActivator)Activator.GetObject
(
typeof(IProcessActivator.IProcessActivator),
"http://localhost:9000/ProcessActivator"
);
process_activator1.Run("IExplore.exe", @"http://www.codeproject.com");
There's also a library called ProcessActivator and it just has the run command... I included the remoting references.. The code runs fine when i run both the server and the client on the same machine... but they won't work with each on a separate pc...
|
|
|
|
|
Nevermind.. I figured it out..
I was making a call to the local machine instead of the remote machine(IP address)
"typeof(IProcessActivator.IProcessActivator),"tcp://localhost:9000/ProcessActivator"
Solution:...
Pass the IP address of the remote machine to the client application
"typeof(IProcessActivator.IProcessActivator),"tcp://192.168.0.104:9000/ProcessActivator"
|
|
|
|
|
I would like to write a picture viewer app that outputs the image over the entire screen, not just the desktop. I can't seem to find the solution to write over the taskbar. Any help would be appreciated.
Thanks
|
|
|
|