|
how about:
ArrayList table = new ArrayList;
SreamReader txtFile = new StreamReader("myfile.txt");
while ((string reader = txtFile.ReadLine()) != null) {
table.add(reader.Split(","));
}
txtFile.Close();
Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
|
|
|
|
|
Hi!
does anyone have some experience with Jpeg2000 and .NET ???
can someone give me some code samples how to compress a picture to
Jpeg2000 with .NET ???
and how to show a Jpeg2000 picture although the picture is not loaded
complete??? (show the Jpeg2000 picture with a lower quality).
how to send (upload) DICOM Header of a Jpeg2000 picture???
best regards,
gicio
|
|
|
|
|
Hi!
does anyone have some experience with BITS
(Background Intelligent Transfer Service) and .NET ???
can someone give me some code samples how to use BITS with .NET ???
regards,
gicio
|
|
|
|
|
Check MSDN, there are several example articles there.
- Nick Parker My Blog
|
|
|
|
|
|
Hi!!
does anyone some experience with BITS
(Background Intelligent Transfer Service) and SSL and .NET ????
can someone give me some code samples how to use it?
regards,
gicio
|
|
|
|
|
I have several devices on a local network that I talk to. But if a device is turned off, .Connect takes more than 30 seconds to return. How do I get .Connect to timeout, within a second, if the device is not on the network?
Brian
|
|
|
|
|
Socket.SetSocketOption() method
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
I set the SocketOptionName.SendTimeout and SocketOptionName.ReceiveTimeout, but it didn't affect the Connnect timeout.
Brian
|
|
|
|
|
Hi, all!
How can I crate TextBox which would display 'circles' instead of '*' in WinXP?
Currently I have TextBox with PasswordChar set to '*' because of I do not know how else I can say that this is a PasswordBox.
I enabled Visual Styles through manifest but it still shows '*'
Thanks.
Regards,
alexx.
|
|
|
|
|
you can use the dot character (copy and paste one of these)
• ( U+0222 arial)
● ( U+25CF times new roman)
or any other character in the Windows' CharactersMap (unicode section)
|
|
|
|
|
Hello, Claudio!
But in that case I'll got the same char in Win2k and I do not want to.
Thanks.
Regards,
alexx
|
|
|
|
|
if you want to display the normal asterisk character in a Windows System < win2K
you can use this:
<br />
if ((Environment.OSVersion.Version.Major >= 5) || ( (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 4) ))<br />
{<br />
textBox1.PasswordChar= '•';
}<br />
bye
|
|
|
|
|
Look for TextBox.PasswordChar property. You have to set this property.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
|
A simpler way is to set the PasswordChar property. This re-creates the handle of the TextBox with the ES_PASSWORD style.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi, all!
I have several controls, bounded to public properties of my Settings class. Those are edit boxes, check boxes and combo. MSDN says that in this case bounded property is updated immedeatly when control's text changes, but I have update is done only after control looases focus...
What is wrong? I want to track changes to Enable Apply button on my form after user changes one of the controls text.
Thanks.
Regards,
alexx.
|
|
|
|
|
The control's text isn't changed until the control looses focus. Up until then, you're merely filling the UI with data. The text isn't committed to the appropriate property until it looses focus. To see this, handle the TextChanged event, for example. Things like check boxes are set immediatley, though, because it requires a simple action (a click).
If you want to get an order of events that happen, see the GotFocus Event[^] documentation in the .NET Framework SDK, for example.
You'll also notice this behavior in Windows in some places, too. If you want to change it, you could assume that any change to a TextBox (for example) will change the data (even though they might undo their changes). There's many ways you could handle this solution. For instance, handle the KeyUp event (handling this as opposed to KeyDown at least lets savvy users press Esc before letting up to cancel the current character) and enabling your Apply button in the handler. You could, in this case, simply point all TextBox es to the same handler as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello, Heath!
Thanks in advance!
I want to get TextBoxes to function as for example CheckBoxes : immedeatly apply Text changes to bounded property. Example of that You can see in VS Project Properties dialog : if I change any setting in the Property Grid and then move mouse on to Apply button which is not enabled yet and then press mouse button this ENABLES Apply button but not clicks on it and when You do second press it clicks button. How can I do that? When I clicking on my Apply button which is Disabled currently edited textbox does not loose focus! How can I catch that user is going to stil focus from currently focused control? In VS when I press mouse button first time Apply button is enabled but focus is still in property grid
Thanks
|
|
|
|
|
Again, that's a focus issue. When you attempt to set the focus to a button (even though it doesn't gain focus since it is currently disable) the TextBox looses the focus which commits the text and then the TextChanged event is fired. Again, if you want the Apply button be enabled upon making any change regardless of focus, you need to handle one of a couple different of events (like KeyUp ) or override several methods (like OnKeyUp ) in a derived class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi
anyone know any good tool for reformatting c# code.
and by reformat i mean move all public methods to one place , all public propps to another etc etc.
//Roger
(i saw an addin/macro that did that once but i forgot the name)
|
|
|
|
|
|
Hi Guys,
I was able to create a program which will run 3 process at the same time using threads but the criteria or paramaters that I used is HARDCODED (IP ADDRESS/PORT). Now I need to create the same program using threads but the only difference is that IP/PORT is coming from the table and I need to pass it from the class one at a time.
Please somebody help me I'm not good in CLASS, i'm trap with this thing, this is the only one left....
dabuskol
|
|
|
|
|
Just create a class to from which the thread is started that hold these values like so:
using System;
using System.Threading;
public class MyClass
{
public string s1, s2, s3;
public MyClass(string s1, string s2, string s3)
{
this.s1 = s1;
this.s2 = s2;
this.s3 = s3;
}
public void Start()
{
new Thread(new ThreadStart(StartInternal)).Start();
}
private void StartInternal()
{
}
} This is a VERY basic example, but should hopefully give you one idea.
Another way is to pass arguments to the thread. The Thread class isn't capable, but ThreadPool.QueueUserWorkItem is:
object[] parms = new object[] {"Test", 1, Color.Red};
ThreadPool.QueueUserWorkItem(new WaitCallback(SomeMethod), parms); If you want more ideas, click "Search comments" above because we've discussed this many times in the past. You should also read about Threading[^] in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Guys,
Thank You very much.
my problem right now is that when I run my program it gave this error message:
"THE I/O Operation has been aborted because of either a thread exit or an application request"
Here is the code where the took place.
public void OnDataReceived(IAsyncResult asyn)
{
try
{
CSocketPacket theSockId = (CSocketPacket)asyn.AsyncState ;
//end receive...
int iRx = 0 ;
iRx = theSockId.thisSocket.EndReceive (asyn);
char[] chars = new char[iRx + 1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(theSockId.dataBuffer, 0, iRx, chars, 0);
System.String szData = new System.String(chars);
txtDataRx.Text = txtDataRx.Text + szData;
WaitForData();
}
catch (ObjectDisposedException )
{
System.Diagnostics.Debugger.Log(0,"1","\nOnDataReceived: Socket has been closed\n");
}
catch(SocketException se)
{
MessageBox.Show (se.Message );
}
}
I'm connecting to server(s) and then retrieving data and insert in into my SQL database.
/dabuskol
|
|
|
|