|
|
Does C# has browse directory dialog?Something like SHBrowseForFolder that we use in VC.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Thanks.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Is it possible to create a client/server socket that can send data in the main thread and receive data in a separeted thread?
And one thing more:
In my second thread, that thread that receives data, I want to show the data in a ListBox in the main thread. Is it safe to pass the Form object of the main thread to the second thread.... hm.. difficult to explain... I hope you understand!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
I'm not using sockets to communicate with my threads!
I wonder if I can do the all receiving in a separeted thread and if I can send data in a second thread.
But then... In my second thread, which one I do I all ReadLine on my NetworkStream, I want to show the received data from the socket in a list box IN THE MAIN THREAD, which one I WriteLine to my NetworkStream!
Do you understand now?
If you can answer the first thing it's enough!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi
You shouldn't have to bother with threads. Asynchronous methods already provided (see BeginXXXX() andEndXXXX() of Stream class) should do the trick and everything could be run from the main thread.
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
I will try that!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
send data in the main thread and receive data in a separeted thread
You could share the object between the threads; but you'll have to make sure you take measures to ensure both aren't used at the same time.
Rickard Andersson wrote:
Is it safe to pass the Form object of the main thread to the second thread
Yes its safe, its what you do with the ListBox that could be dangerous.
The key to multi-threaded Windows Forms UI interaction should answer your questions about how you should go about using it safely from your second thread.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
James T. Johnson wrote:
but you'll have to make sure you take measures to ensure both aren't used at the same time.
can I use lock(...) to prevent that?
or, I use async sockets...
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
can I use lock(...) to prevent that?
Yes, you can.
Rickard Andersson wrote:
I use async sockets...
That would work too; however you don't get to control the thread that is used for it (a ThreadPool thread is used to execute the method)
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Does anyone know how to convert a string to DateTime? I am reading in a string from a flat file, that is being parsed and certain pieces need to be converted to other types. But I don't know how to declare a variable to date type in C#.
|
|
|
|
|
Convert.ToDateTime or DateTime.Parse
Paul
|
|
|
|
|
I tried something like the following and it didn't like it.
string tempstr, blk_tkt_date1;
tempstr = inpu.Substring(5, 8);
blk_tkt_date1 = Convert.ToDateTime(tempstr);
The error I get is "Cannot implicitly convert type 'System.DateTime' to 'string'".
|
|
|
|
|
Because blk_tkt_date1 is defined as a string.
What you're doing here is converting it to a datetime and passing it back into a string, which isn't possible.
Depending on what you really want to achieve: either define blk_tkt_date1 as a DateTime or replace the ToDateTime line with
<br />
blk_tkt_date1 = Convert.ToDateTime(tempstr).ToLongDateString();<br />
There are several alternatives to ToLongDateString, depending which format you want it in.
|
|
|
|
|
Thank you! I am needing to convert the string that is coming in to a DateTime.
Once again, thank you!
|
|
|
|
|
hi,
i'm using XmlDocument.Load(strURL) in my application. when i upload a new version of the file at strURL on my webserver and load that document again in my windows-app via XmlDocument.Load() i still get the old version of the file.
when i open my browser, input the url and type reload, my application gets the new version afterwards.
so somewhere in between the old version of the file is cached, but i really want XmlDocument.Load() to connect to the server and get the latest version of the file (what my browser does, when i choose "reload"). any suggestions?
does this have something to do with the proxy-server in my company here? or is it a behaviour of my windows-system, which can be turned off (by any programmer, for instance me)?
:wq
|
|
|
|
|
|
|
Environment.OSVersion
Paul
|
|
|
|
|
|
Hi,
does any one knows where can I find extense documentation about parameters type changing between unmanaged Win32 DLLs and NET managed code calling?
...I'm trying to call unmanaged code DLLs and I have problems of Null Reference Exceptions (in this first step, later I'll surelly have problems of type incompatibilities)
Please, give me any information you can.
Thank you in advance,
Edgar
Edgar Berengena Moreno
Software Engineer
Appeyron Research
|
|
|
|
|
|
MSDN gives you most of the answers. Have a look at Interoperating with Unmanaged Code[^]
Like Eric answered my post, its best to give a specific example and to work on that. In the unmanaged world not all things are equal. Also to make code CLS-Compliant stick to signed types.
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|