|
I have data in three array a b c. The data in each array is of different length.
I want to output the data to a text file in following way.
elements in a starts at column 2
elements in b start at column 15
elements in c start at colum 25
I will have
-2-------15-------25
a1 b1 c1
a2 b2 c2
-----
an bn cn
how can i do that?
Thanks
|
|
|
|
|
zhujp98 wrote: I have data in three array a b c. The data in each array is of different length.
I want to output the data to a text file in following way.
elements in a starts at column 2
elements in b start at column 15
elements in c start at colum 25
Use .PadRight()
foreach(Int32[] cells in rows) {
sw.Write(" ");
sw.Write(cells[0].ToString().PadRight(14, ' ');
sw.Write(cells[1].ToString().PadRight(9, ' ');
sw.WriteLine(cells[2].ToString());
}
Share and enjoy.
Sean
|
|
|
|
|
Try this creating your graphics object like this:
Graphics gfx = Graphics.FromImage(img);<br />
Where img is the image you want to draw on
Then you can use gfx to draw on the image.
|
|
|
|
|
hi
i made an application that contains speech recognition and i want to make it includes profiles for each user and training also, like the speech at windows XP,please help me at that.
thank you
Fox
|
|
|
|
|
If you have a specific C# problem then elaborate...
Ed
|
|
|
|
|
I thy to change lifetime mode of ordinary registered singleton to "live forever".
Try this:
----------------
public override object InitializeLifetimeService()
{ ILease lease = (ILease)base.InitializeLifetimeService();
if (lease.CurrentState == LeaseState.Initial)
{ lease.InitialLeaseTime = TimeSpan.Zero; }
return lease; }
----------------
Or Try this (as reccommended):
----------------
public override object InitializeLifetimeService()
{ return null; }
----------------
But in both cases singleton die after 5 min.
When I try to get it's method I get just this exception:
----------------
System.Runtime.Remoting.RemotingException: Object
has been disconnected or does not exist at the server.
Server stack trace:
at
System.Runtime.Remoting.Channels.ChannelServices.CheckDisconnectedOrCreateWellKnownObject(IMessage msg)
at System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
----------------
That means that overriding of InitializeLifetimeService() has no effects!
How can it be possible?
Thanks a lot for any help.
|
|
|
|
|
I need to write an application that will open a windows application (platform builder), wait for it to open, give it the focus, and then press a button to attach a device or send keys to the application.
1. Open application
2. Give the application the focus
3. Start the attach device function by sending in keys to the app
4. Parse the debug information until the device is connected.
|
|
|
|
|
And your question is ??????
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
-- modified at 4:38 Saturday 18th March, 2006
|
|
|
|
|
1. Use Process.Start("");
2. Use SetFocus API
3. Send.SendKeys("");
4. ????
Regards,
1tg46
Check out 3D Game Development with Dark Basic Professional [^]programming.
|
|
|
|
|
Is it possible to make the size of the array dynamic.
eg:
->here is a part of a recursive function , which extracts the files in a directory and its subdirectories,
->As it is not know the number of files that will be retrieved , i cannot assign a size for the array "files".
foreach(FileInfo b in dirPath )
{
files[ctr]=b.FullName ;
ctr++;
}
|
|
|
|
|
No. Use a list instead, like an ArrayList or a HashTable.
---
b { font-weight: normal; }
|
|
|
|
|
I am trying to generating a smart tag through that smart tag i want generating a table in the current word doc..
I generated a smart tag but it opens a new instance of the doc and generate the table in that..
So i m getting a problem to fetch the current instance of the doc..
Anybody can suggests
How can I get the current instance of the word doc through C# coding????
Thanks…
|
|
|
|
|
Need help to create simple fibonacci recursive, factorial, GCD recursive, the towerof honei.
buzz up
|
|
|
|
|
So, you simply want someone else to do your homework, so that you can get a grade that you don't deserve?
---
b { font-weight: normal; }
|
|
|
|
|
dude,just because Im asking a question doesnt meant Im doing it my homework? , but thank anyway!!
buzz up
|
|
|
|
|
shizzlebrown wrote: dude,just because Im asking a question doesnt meant Im doing it my homework? , but thank anyway!!
Then WTF are you asking the question for? You have not replied with ANY reasonable information for us to help you, so either put up or shut up - dude.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
shizzlebrown wrote: Need help to create simple fibonacci recursive, factorial, GCD recursive, the towerof honei.
Don't you mean the towers of hanoi?
In any case what part are you having problems with? Understanding the homework question, don't know where to start, can't put logic to code, want an entire program written for you etc...?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
thank u for ur kind?
buzz up
|
|
|
|
|
i have been working on FTP (file transfer protocol) . actually i wanted to design a client that can download and upload files to a ftp server. I have a problem that how I download and upload the file through ftp(file trasfer protocol).
haseeb
|
|
|
|
|
How to create a file rpt for a new crystal report layout? thank you
|
|
|
|
|
the column click event from listview doesnt handle the right mouse button? how to get it working
|
|
|
|
|
You need to override the OnMouseDown event and check the parameter
if(e.Button == MouseButtons.Right)
object obj = this.shapesListView.GetChildAtPoint(e.Location);
...
Check out the following article for details.
|
|
|
|
|
Good day Guys,
Please help! I'm in a dire situation right now. I have a program which works much like a cash register. I have a set of command buttons in one form in which I want to change the properties (e.g., text/caption, font size, backcolor, etc...) based on what is stored from the database. The thing is, I don't know how can that be specified! Please help!
|
|
|
|
|
Ok I am in a dilema here. I am working on a BI module. I am reading the data from a tabl using a Sql's "With Cube" function, my result set looks like following:
+---------+-------------+----------------+
|#ofReqs--|---SDate----|Department------|
+---------+-------------+----------------+
|--------3|3/10/2006----|--Hardware-----|
+---------+-------------+----------------+
|--------2|3/12/2006----|--Hardware-----|
+---------+-------------+----------------+
|--------5|3/15/2006----|--Hardware-----|
+---------+-------------+----------------+
|--------4|3/17/2006----|--Hardware-----|
+---------+-------------+----------------+
|--------9|3/10/2006----|--SoftWare-----|
+---------+-------------+----------------+
|--------8|3/12/2006----|--SoftWare-----|
+---------+-------------+----------------+
|--------5|3/14/2006----|--SoftWare-----|
+---------+-------------+----------------+
|--------9|3/15/2006----|--SoftWare-----|
------------------------------------------
What I need is a collection of Reqs; a collection of Date; a Collection of Department but I need them to be related with each other cuz I need to use them on a graph.
What I am trying to display on the graph is as follows:
Day wise No of Reqs made to a Department.
something like NameValueCollection<string, string=""> so if a string key [Department] is repeted the result would get added to it another element does not get created; but with three values NameValueCollection<string, string,="" double="">
Whatever.Add("Software", "3/14/2006", 5);
//result Software [Key] - 3/14/2006, 5 [Value]
Whatever.Add("Hardware", "3/14/2006" 3);
//reult Hardware[Key] - 3/14/2006, 5 [Value]
Whatever.Add("Software" - 3/10/2006, 4);
//result Software [Key] - [3/14/2006, 5] [3/10/2006,4] [Value]
Something like... I dont know, I hope I am not over complecating the problem. Does any one have a clue what I am talking about
|
|
|
|
|