|
I think this works:
foreach(Object <code>o</code> in <code>this</code>.<code>listBoxLog</code>.<code>Items</code>)
fout.Write((<code>string</code>)<code>o</code>);
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Thank you again...
/\ |_ E X E GG
|
|
|
|
|
Are dynamic textboxes or labels possible? Like for example you want to get a list of names and you want to put it in labels but you wouldnt know how many names will be sent?
"To teach is to learn twice"
|
|
|
|
|
Dynamic controls are very easy to implement. For example:
Label lblName ;
foreach(string sName in arrName)
{
lblName = New Label();
lblName.Text = sName;
myForm.Controls.Add(lblName);
}
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|
|
Is it possible to make a program in C# that will serve as the exe file for autorun cds? if not, wat software do I use?
"To teach is to learn twice"
|
|
|
|
|
|
But wud the executable run even without the .net framework on the other pc? If not, what is the most commom dev tool used to make an autorun executable?
"To teach is to learn twice"
|
|
|
|
|
daljv wrote:
But wud the executable run even without the .net framework on the other pc? If not, what is the most commom dev tool used to make an autorun executable?
If you use any CLS-compliant language you'll need the .NET redistributable on the target machine. An alternative is to use something like Macromedia Director or Macromedia Flash (make a standalone exe). You could also use the now obsolete VB6 (and hope that they have the VB runtime DLLs)
The safest approach would be to use HTML pages (you can then have gifs, jpgs, swf etc in sub directories)
Nish
Extending MFC Applications with the .NET Framework [NW] (My book with Tom)
Summer Love and Some more Cricket [NW] (My first novel)
Shog's review of SLASMC [NW]
Come with me if you want to live
|
|
|
|
|
but if html were to be used, wat wud i place in my autorun.inf?
|
|
|
|
|
|
Nishant S wrote:
You could also use the now obsolete VB6 (and hope that they have the VB runtime DLLs)
You'd be surprised if I tell you the number of projects done at present day using VB6.
- Kannan
|
|
|
|
|
|
But for windows client applications which needs to go into desktops of the masses, I guess people would still prefer using the RAD tools of the past.
I dont think its justified to download a 20mb runtime for a program that has a couple of dialogs. Probably thats one of the reasons we havent seen some cool products (something popular like winzip or a messenger).
- Kannan
|
|
|
|
|
Ok here is the scenario. I have an automated process manager that I am running, it is polling using the timer class every 10 minutes to see if something needs to be run.
If the window is FormWindowState.Normal the memory is between 11 - 21 meg which is fine, when I minimize the window it drops memory useage to around 600k, which is great.
However if I try to run GC after a poll and successful process run, the memory doesn't seem to get collected no matter what I try. I would expect memory to realease to at least 3 - 4 meg once the process is completed however when I call GC this doesnt happen, if I manually minimize the display the memory releases down to 600 - 800k. So I dont think I have references in place that should be there, its almost like GC doesnt fire until I minimize.
Any thoughts?
|
|
|
|
|
One other quick question is there an event that fires when FormWindowState property is changed? I cant find one in documentation but wanted to make sure I wasnt overlooking anything.
|
|
|
|
|
well you cant really force the GC to run your just asking it to.
implement the dispose method on those references and set them to null so you can force the release.
make sure no other object holds a reference to it or it will not release. Much like the old com refernece counter.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Hello !
is there an efficient way to trim a byte[] to a new size?
i need this for a socket.receive:
byte[] data = new byte[1024]; //Input-Buffer
int recv = s.ReceiveFrom(data,ref sender);
i tried this:
byte[] trimmedData = new byte[recv];
for (int i = 0;i
|
|
|
|
|
The best way to do this is to use a vector<byte> and then you can just use resize().
[edit]
Whoops. Thought I was in the C++ forum. Sorry
[/edit]
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
I read the first line and thought," WHOA, we can do vectors in C# ??? ".
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|
|
lol
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
byte[] trimmedData = new byte[recv];
Array.Copy(data, 0, trimmedData, 0, trimmedData.Length );
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
hi
i wanna ask about how can i control the connection of the internet of a pc within lan(lased line)
i mean how can i pause and restore the connection again in this pc
HINT: again the connect isn't dial up connection
it is lased line and all computers connected by network and the
connection of the internet within this lased line
thank you and i hope u can help me
Ahmed Mazrou3
|
|
|
|
|
your going to need to use the wininet.dll to control internetconnect and few other functions from that library
http://www.c-sharpcorner.com/vbnet/vbcode/CallingWinInetVK.asp
This shows some examples
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Here's my class...
using System;
using System.Windows.Forms;
namespace GPG__
{
public class logging
{
LOG logForm=new LOG();
aOut caller=new aOut();
Form1 guiForm=new Form1();
int k;
public logging(string [] aLog, string start, string end, string duration, int delay, string file)
{
logForm.Show();
logForm.listBoxLog.Items.Add(DateTime.Now.ToString("hh:mm:ss")+": Processing: "+file);
<big> if(guiForm.checkBoxEnableDelay.Checked==true)
{
MessageBox.Show("CHECKED");
logForm.listBoxLog.Items.Add(DateTime.Now.ToString("hh:mm:ss")+": Delay "+delay.ToString());
}
else
{
MessageBox.Show("NOT CHECKED");
}</big>
for (k=1; k<aLog.Length; k++)
logForm.listBoxLog.Items.Add(DateTime.Now.ToString("hh:mm:ss")+": ["+aLog[k].ToString()+"]");
}
}
}
Now, look at the if statment asking if checkBoxEnableDelay is checked...
When ever I run this, it always evaluates to false, and the else stament runs... and yes, the box IS checked...
If I put the same code on my main FORM it runs fine...
WHat is the problem?
p.s. (ignore the broken for statment at the bottom... it's not like that in my code..._)
/\ |_ E X E GG
|
|
|
|
|
hmm... I think it has somthing to do with if the check box is checked at form load, or not...
cause if I set the checkbox to checked in the PROPERTY EXPLORER, the if statment elvaluates to true. But if I un check it in the RUNNING FORM, it still evaluates to true...
and it's the same vice versa... if I uncheck it in the PROPERTY EXPLORER, it will elvauate to false, even if I CHECK it in the running FORM...
any ideas?
/\ |_ E X E GG
|
|
|
|