|
I want to connect two pc through ip address and start chat with one to another like my pc and my friend pc having no physical connect except they are connect through internet
can any one help ??? Using c# and socket programming
|
|
|
|
|
You will probably have to traverse NAT at some point, so look into how to do that.
Apart from that, it's much the same as on a LAN.
|
|
|
|
|
Can u explain it further?
|
|
|
|
|
There are plenty of chat server/client examples on the web.
Try googling chat server/client example
|
|
|
|
|
Hello,
I have a function, and i would like to let a list/array of Threads run parallel in it (inorder to protect critical sections in it).
I thought I'd create List<mutex> and assign each one to a different Thread:
for( int i =0; i<10; i++)
{ arrmutex[i] = new mutex(); }
and in the function i would like to lock with a
arrmutex.elementAt(someThread).waitOne() -> a specific variable
It tells me that i cannot do that cause my mutex list is not initialize, AND, the lock wouldn't work..
Can you please help me figure out, how to initialize a list/array of mutexes?
and how to assign each thread a mutex?
Thanks,
|
|
|
|
|
Why us a Mutex?? Are you trying to synchronize an operation between processes??
What exactly are you trying to do with this set of mutexes??
Should you be using a ManualResetEvent instead??
|
|
|
|
|
hi
I have a question about forms in c#.
every time i run the program on a different laptops with different size of screen the items that have the forms have not be in the same location that i have put it the first time on my laptop.
how can i make the appearance of the items that have the different forms to be to the same location on every laptop or pc i run my program?
can i make it parametric?
thnx
|
|
|
|
|
|
im trying to remove a tab page from my tabcontrol
based on its tab index
but i have the tab index in an int
heres the code
if (e.Button == MouseButtons.Right)
{
for (int i = 0; i < tabControl1.TabCount; i++)
{
Rectangle r = tabControl1.GetTabRect(i);
if (r.Contains(e.Location))
{
if (i == 0)
{
}
else
{
string tabindexint = i.ToString();
tabControl1.TabPages.Remove(i);
it wont let me use an interger as a tab index how could i possibly do this
|
|
|
|
|
|
|
I REALY need to use the int tho because thats how i get
that selected tab name since its a right click selection
not a left click selection u can see it in the code
|
|
|
|
|
Try RemoveAt() - myTabControl.TabPages.RemoveAt(i);
|
|
|
|
|
thx and how do i get the page name of a tab based on is index
like what is the name of tab at index 4
|
|
|
|
|
Try something like
for (int i = tabControl1.TabPages.Count - 1; i >= 0; i--) {
if (tabControl1.TabPages[i].Text == "Header")
}
|
|
|
|
|
i got it to work using this
string tabpagenamex = tabControl1.TabPages[i].Name;
can u explain what the [] part means to tabpages
|
|
|
|
|
It means absolutely nothing to TabPage.
It means everything in C# because that's an array you're indexing into.
If you didn't know this, you REALLY need to pickup a beginners book on C# and work through it. Arrays are something you learn about in the 1st or 2nd week of an intro to programming class.
|
|
|
|
|
[] basically accesses an array item.
As mentioned, it might be useful for you to catch up on some basics.
|
|
|
|
|
definitly ive only been doing any sorts of coding for two months
im learning as i go still most of it is uncomprensible
but i think im doing prety considering my lack of prior
knowledge
|
|
|
|
|
Keep learning new things while practicing - that is the only way to make more topics comprehensible.
|
|
|
|
|
hi,
is there a way that i can get the attributes in my class dynamically like calling a function which return all the attributes in my class in an list/array?
however, without hard-coding so that even when my class attributes changes i dont need to change this function
|
|
|
|
|
Try:
Type type = typeof(MyClass);
object[] oat = type.GetCustomAttributes(true);
foreach (object at in oat)
{
Console.WriteLine("{0}", at.ToString());
}
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
The method 'PrintAuthorInfo in this on-line MSDN example of custom Attribute use [^] shows you how to get all the Attributes into an Array of System.Attribute, and access fields, and call a function that returns a string.
“Humans are amphibians: half spirit, half animal; as spirits they belong to the eternal world; as animals they inhabit time. While their spirit can be directed to an eternal object, their bodies, passions, and imagination are in continual change, for to be in time, means to change. Their nearest approach to constancy is undulation: repeated return to a level from which they repeatedly fall back, a series of troughs and peaks.” C.S. Lewis
|
|
|
|
|
Hi,
Please let me know how may I store follow string value into string variable ?
string myValue = "aa[a"a]aa";
Thank you in advance
|
|
|
|
|
use a backslash to escape the quote
string myValue = "aa[a\"a]aa";
|
|
|
|