|
Diego, it is not the right way to do it. Use the value returned by Socket.Receive to know how many bytes are read. Read my 2 other replies to your post (the one you show the code used).
-----
Formerly MP(2)
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|
|
Hy does anyone know a good programm to generate a UML diagram out of C# code?
|
|
|
|
|
Star UML[^] has reverse engineering from C# code to UML.
|
|
|
|
|
Hi guys , just wondering if anyone knows much about global mouse hooks in c#. I ve basically used this tutorial to implement a simple hook that can grab mouse clicks and x & y.
http://www.codeproject.com/csharp/globalhook.asp[^]
I now have a requirement where I need to specifically get the name or text associated with the item ive clicked on. IE if I clicked on the 'File' menu in wordXP id like to be able to get the word 'File' and store it in a variable for future use.
Iam pretty sure this task is going to involve monitoring windows messages but iam not really sure where to start. does anybody have any experience in this area?
Thanks Mike
|
|
|
|
|
I have an C# ASP.NET web page. I have this conversion problem with my string array to my session variable.
string[] stModArray = (string[])Session["modArray"];
Any suggestions...... Thanks in advance!!
Michael
|
|
|
|
|
Hello,
As the Session["modArray"] is only returning a string or null you can not cast it directly to string[].
You would have to create an string[] instance and add the result string to the array (at the index you would like it to be).
To make it dynamic, you caould use a System.Collections.Specialized.StringCollection (with the "add" method) instead of string[].
P.S.: allways make a !=null check.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Do this:
object o = Session["modArray"];
and check in the debugger to see what's actually stored there. If it's not a string[], you can't turn it into one, at least not like this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ok, what I have in this variable are three primary key numbers, so what's getting stored is an int. But the reason why I'm using a string is because I need to return the length for my for loop so the user can cycle backwards and forward viewing each record.
-> There are no nulls getting passed in, what's getting passed in is correct.
This is the snippart of the code that I'm using to try and do what I've just explaned. Once again since I'm I using a loop, objects and such don't have the length function :'(
private void nextMod()
{
string[] stModArray = (string[])Session["modArray"];
for (int i=0; i
|
|
|
|
|
Hi,
Does anyone know how to show and hide a layer in a Visio shape in c#.NET.
Thanks!
|
|
|
|
|
Hi,
I have some custom controls and all have methods BeginInit() and EndInit() in it.
In most cases both methods are empty and probably will always empty.
Is there any performance problem, because I notice in myForm.designer all controls have this two lines:
((System.ComponentModel.ISupportInitialize)(this.crLabel20)).BeginInit();
(System.ComponentModel.ISupportInitialize)(this.crLabe20)).EndInit();
I suppose for all controls both methods are called at runtime. Is this performance wasteful?
Thanks and sorry my english,
Jure
|
|
|
|
|
Hello,
Tavbi wrote: I suppose for all controls both methods are called at runtime.
Yes, it will be called from the constructor (InitialzeComponets) of your form. (When you initialize your form)
Tavbi wrote: Is this performance wasteful?
No!
I wouldn't care too much about it.
But maybe if you don't need it at all, you should think of removing it, just to make the code simpler.
All the best,
Martin
|
|
|
|
|
|
|
Err but it looks like these were generated by VS. I wouldn't touch them.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
No, No, No!
What I mean is removing the interface from the Custom controls (labels,...)
Hope he understood it.
|
|
|
|
|
Since that's deigned generated code, the changes you make in there will be overwritten the next time the designed refreshes it. You can also break the designer by messing with that code too!
|
|
|
|
|
No, No, No!
What I mean is removing the interface from the Custom controls (labels,...)
Hope he understood it.
|
|
|
|
|
Error
------------
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
-------------
i try to use this code
but i have error
***************
using System;
using System.IO;
using System.Net;
using System.Text;
namespace Examples.System.Net
{
public class WebRequestGetExample
{
public static void Main()
{
// Create a request for the URL.
WebRequest request = WebRequest.Create("https://isp.paltel.net/login.cfm");
// If required by the server, set the credentials.
request.PreAuthenticate = true;
request.Credentials = CredentialCache.DefaultCredentials;
// Get the response.
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Display the status.
Console.WriteLine(response.StatusDescription);
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
Console.WriteLine(responseFromServer);
// Cleanup the streams and the response.
reader.Close();
dataStream.Close();
response.Close();
Console.Read();
}
}
}
***************
Palestine
|
|
|
|
|
This must be the seventh time you're asking the same question in the last few days.
Last time kubben asked you if you have tried HttpWebRequest.ClientCertificates and you didn't answer.
HAVE YOU??
|
|
|
|
|
Hi all,
I have to switch from one application to another,
I have found this method:
System.Diagnostics.Process.Start("application");
that allow me to open an application...
Then when i press my button for the second time, i don't want
to start a new application but i want to open the existing one.
in this way:
System.Diagnostics.Process[] myProcesses;
myProcesses = System.Diagnostics.Process.GetProcessesByName("application");
i can know if my process is already running but now I don't know
to show this application...
Can someone help me??
Thanks a lot.
Cliffer
|
|
|
|
|
Hello,
You could use the MainWindowHandle property of the process in combination with BringWindowtoTop method of user32.dll.
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int BringWindowToTop(IntPtr hwnd);
public IntPtr HWND_TOPMOST =(IntPtr)(-1);
public IntPtr HWND_NOTOPMOST =(IntPtr)(-2);
System.Diagnostics.ProcessStartInfo psi;
psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
psi.FileName = "???.exe";
using(System.Diagnostics.Process process = new System.Diagnostics.Process())
{
process.Start(psi);
process.WaitForInputIdle();
BringWindowToTop(process.Handle);
}
I'm using this in .Net1.1, maybe in .Net 2.0 there is a more elegant way.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Yes thanks this work fine...
The only problem is that I hope to find a method that works
without import user32.dll
So now i work with this but if someone know a method that not use
user32.dll it would be better..
thanks
|
|
|
|
|
hi,
i want to control the keyboard a system through another system.ie i need to get the controls of the keyboard of a system to the keyboard of another system which are connected through network.plz help me.
Exploring C#...
|
|
|
|
|
Apart from that I don't understand all, it sound a little "illegal"!
|
|
|
|
|
illegal??? havent u seen the VNC viewer????
we are creating a software which enables server to control its clients.....
This code was posted by me...
|
|
|
|