|
try this :
string[] mySitems = new string[lb.SelectedItems.Count];
lb.SelectedItems.CopyTo(mySitems,0);
textBoxX1.Lines = mySitems;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
but there is still problem like that
Error 1 'System.Web.UI.WebControls.ListBox' does not contain a definition for 'SelectedItems'
|
|
|
|
|
You never said it was a Web application - we all assumed you were using System.Windows.Forms.Listbox
I believe you have to loop through all the items in the list and test the Selected property.
Dave
|
|
|
|
|
yes..... i found solution which is following:
protected void Button7_Click1(object sender, EventArgs e)<br />
{<br />
TextBox4.Text = "";<br />
foreach(ListItem Isitem in CheckBoxList1.Items)<br />
if (Isitem.Selected == true)<br />
{<br />
<br />
TextBox4.Text += "\n" + Isitem.Text;<br />
<br />
}<br />
}
|
|
|
|
|
Hi Everyone,
Bit of an obscure question but i can't find an answer elsewhere online so i thought I'd post here.
I'd like to know if there's a way to retrieve a serial port description, as found in Device Manager, i.e. :
Communications Port (COM1)
I can easily get the serial port name using the static SerialPort method GetPortNames() (COM1, COM2 etc) but I cannot seem to find a way of getting the extra description information.
Id like to know because our support team regularly have to launch device manager to check which comm port our USB-Serial converter has been assigned and getting garage monkeys to launch device manager over the telephone is sometimes harder than it sounds!
Thanks for looking!
Chris.
|
|
|
|
|
as far as i know you cannot retrieve additional information about serial ports with the System.IO.Ports classes, but you can use WMI to get the information you need.
check out the win32_serialport class.
/********************************************
* dies & das - dot & net
* http://blog.joachim.at
********************************************/
|
|
|
|
|
|
Is there any method to keep the assemblies in separate folder rather than putting it in the same folder where program is executed ? I am trying to deploy a windows application with dlls kept in a sub directory where application is installed. But it's throwing error which said "Assembly could not be loaded". Is there any other way to do this ?
|
|
|
|
|
AFAIK, The answer is NO. You have to keep the assembles either in GAC or in the same folder along with the executable.
There is a work around. By using System.Reflection.Assembly.LoadFile() or
System.Reflection.Assembly.LoadFrom() methods, you can load the assemblies from a different folder; but you may have to change the design and the application will suffer a little(regarding performance).
*jaans
|
|
|
|
|
After replying to your post, I did some googling and came across this article. It is possible to keep the assemblies in a sub folder. You have to do the following.
1. Keep a config file (YourExe.exe.config)
2. Keep the following configuration settings
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="NewFolder"/>
</assemblyBinding>
</runtime>
</configuration>
For more info check this link
http://msdn2.microsoft.com/en-us/library/823z9h8w(VS.71).aspx[^]
Today I learned some more...
*jaans
|
|
|
|
|
That looks great jaans. I will try it today. Thanks
|
|
|
|
|
Hi,
I want to write a program in VB 6.0 to access files and directories from a remote server using windows authentication .
But I am not familiar with this.
Appreciate your help.
kalam.
|
|
|
|
|
kalam wrote: I want to write a program in VB 6.0 to access files and directories from a remote server using windows authentication .
Then why ask in the C# forum?
|
|
|
|
|
kalam wrote: I want to write a program in VB 6.0
you put the question in wrong forum !!!
try it in VB Section !!!
Good luck!!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Hi,
I created a hash table with 3 elements.
hashtbl.Add(1, "aaa");
hashtbl.Add(2, "bbb");
hashtbl.Add(3, "ccc");
When I'm trying to modify the hash table as following,
hashtbl[2] ="xxx";
hashtable's length increased by 1.
After the above statement, hashtbl looks as following.
hashtbl[2, "xxx"]
hashtbl[1, "aaa"]
hashtbl[2, "bbb"]
hashtbl[3, "ccc"]
How can I restrict the hash table to add a new element with the same index, 2? I would like to get hashtable as below after the modification.
hashtbl[1, "aaa"]
hashtbl[2, "xxx"]
hashtbl[3, "ccc"]
Thanks in advance..
|
|
|
|
|
Is this using the built-in HashTable class? I would recommend using Dictionary<int, string>[^] instead. Your problem may have been due to some weirdness while boxing.
|
|
|
|
|
Thank you Vega02. Its worked and come to know about Dictionary class.
|
|
|
|
|
Vega02 wrote: Your problem may have been due to some weirdness while boxing.
That is exactly the reason for the problem. The HashTable class uses reference types as identifiers, so if you try to use value types as identifiers, they are boxed first.
Each time you box the value 2, it becomes a new object on the heap, containing the value. As they are separate objects, they have different hash codes.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Shouldn't the hash codes be the same, since they represent the same underlying value? It doesn't matter that they're boxed value types. They don't have reference equality, but they still have value equality, hence they should have the same hash code.
|
|
|
|
|
Vega02 wrote: Shouldn't the hash codes be the same, since they represent the same underlying value?
No, the values are boxed in a type Object, and the hash code of the Object is not based on the boxed value.
The GetHashCode method of the Object type is not suitable for use as key in a hash table. From the documentation:
"the default implementation of this method must not be used as a unique object identifier for hashing purposes"
MSDN Library: Object.GetHashCode method[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
hi
As you told that you use msaccess database then no requirement to include database seprately. to deploy your project do the following..
1. File -> New Project -> Choose Other Project -> then Setup project
2. In the application folder add all the files available into your bin folder including the database file also.
Yogesh Agarwal
|
|
|
|
|
Hello,
I'm trying to make connection between a C# client to a C++ server.
Since I'm new at C/S I just downloaded sample programs, and tested them.
I downloaded the C++ server (and client) from:
http://www.codeproject.com/KB/IP/client_server_socket.aspx
The communication succeeded.
I also downloaded C# C/S from:
http://www.codeproject.com/KB/IP/tcpclientserver.aspx
It also worked.
But when I tried to make a connection from the C# client to the C++ server it didn't work (later on I also tried other versions of servers and clients in both languages – none worked).
What I see is that the client succeeded to connect to the server, but it didn’t succeed to send anything to the server, and the server stayed blocked waiting for the client's message (I encountered a version in which the server did get a message, i.e. was released from the blocking condition, but the message was empty).
BTW, when I changed the code such that only the server sends a message to the client - everything worked.
I don't know what problem to look for, nor if there is any known problems in this scenario.
I will really appreciate any help or idea what to do.
Thanks,
Itzik
|
|
|
|
|
Probably you need to examine what the code does in both instances to make sure they are communicating on the same port, and expecting to send/recieve data in the same format.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your reply.
I checked it over and over ):
The ports are OK (The server does get the connection from the client).
Regarding the formats: the server is not released from the blocking situation of waiting for data (receive). So, is it possible that C# sends different format for simple strings (UTF, or something else) than C++, and is this format change can cause that the 'receive' function stays blocked?
modified on Tuesday, March 4, 2008 11:56 AM
|
|
|
|