|
hi, i was wondering....how do you determine when to use sockets in networking. What conditions or requirement that needs sockets. the socket is from "using system.net.socket"
Thanks in advance
|
|
|
|
|
Hi,
Sockets are used when you want to exchange data between several applications using TCP/IP or UDP protocol. Try this [^] article.
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
I development a project which has component at:
http://www.soft4science.com
I downloaded but i hav'nt got licence.
Please send me if:
+ You crack it.
+ You have license.
any people which same me. Pls Discuss with me.
-----------------------
thanks & best reguards.
Tuongnd80@yahoo.com
tuongnd
|
|
|
|
|
?????
Just buy the license. Only 299USD.
http://www.soft4science.com/products/MathMLControl/s4s_Order_MathMLControl.html
|
|
|
|
|
can somebody explain to me in C#
1>what are the different ways to call a function in C#?
2>how to declare a function with parameters?
3>how to call a function with parameters?
4>MOST IMP:how to return a value form a function?
its urgent.please explain in very simple terms
thanking you in advance
j
j
|
|
|
|
|
Your Ans~
Trustapple wrote: 1>what are the different ways to call a function in C#?
Just Write the function name from where you want to call with proper argumnet. suppose , Add(int a,int b) is a function you just call it by
Add(5,6), if its return some value then s=Add(5,6).
You can invoke a function using Deligation also.
Trustapple wrote: 2>how to declare a function with parameters?
int Add(int a,int b)
void AddString(Sring s1,string s2)
Trustapple wrote: 3>how to call a function with parameters?
That i already explain
Trustapple wrote: 4>MOST IMP:how to return a value form a function?
just Simply use return statement
int Add(int a,int b)
{
int c=a+b;
return c;
}
Happy Programming
-----
Abhijit
|
|
|
|
|
Awesome....Thanks a lot.
but i have a small doubt
"Just Write the function name from where you want to call with proper argument. suppose , Add(int a,int b) is a function you just call it by
Add(5,6), if its return some value then s=Add(5,6)."
i didnt understand this
now one more issue:
i wrote a code with two classes....
even with out linking the classes i am getting the correct output????
can you look into this and guide me where i am going wrong please......
class Program
{
int x;
int y;
int result;
char oper;
public int Add(int x, int y)
{
result = x + y;
return result;
}
public void display()
{
Console.WriteLine("{0}", result);
}
thanks again
class jiju
{
static void Main()
{
Program obj = new Program();
obj.Add(10, 20);
obj.display();
Console.ReadLine();
}
}
}
j
|
|
|
|
|
Trustapple wrote: Just Write the function name from where you want to call with proper argument. suppose , Add(int a,int b) is a function you just call it by
Add(5,6), if its return some value then s=Add(5,6)."
i didnt understand this
I just want to mean that if you have a function Add(int a ,int b) , u can call it by using Add(5,6)
that is
Void Add(int a,int b)
{
int c=a+b;
Console.Writeline(c.ToString());
}
Here no return , so u have to call it by Add(value1,value2)
and if the defination is like this , that its return the value
int Add(int a,int b)
{
return a+b;
}
Then u have to call it using result=Add(5,6);
Hope now it clear to u....
And ur code is correct.... what is the problem r u facing with it !!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
Your code works, but there are several things you can change here.
class Program
{
public int Add(int x, int y)
{
int result = x + y;
return result;
}
public void display(int result)
{
Console.WriteLine("{0}", result);
}
}
class jiju
{
static void Main()
{
Program obj = new Program();
int result = obj.Add(10, 20);
obj.display(result);
Console.ReadLine();
}
}
or
class Program
{
public int Add(int x, int y)
{
int result = x + y;
return result;
}
}
class jiju
{
static void Main()
{
Program obj = new Program();
int result = obj.Add(10, 20);
Console.WriteLine("{0}",result);
Console.ReadLine();
}
}
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
hi Andrei and abhijit,
thanks for the help.....
but what is confusing here is
in my code i have two classes and i didnot link the two classess......
but still i am getting the result ie my function is in parent class....
but i am calling it from the child class.....
but i didnot link the two classess
so how is it working..... ?
can you guys help me here????
thanks again
j
|
|
|
|
|
Jiju class is an inner class to Program in your example. Take a look at this [^] code. It is self explanatory of how inner classes work. You read also this [^]CodeProject article for more details.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
thankyou Andrei
one more doubt while i saw a code regarding functional overloading like this.....
class Program
{
int a;
int b;
int c;
public Program()
{
}
public Program(int x, int y)
{
a = x;
b = y;
}
public Program(int x, int y, int z)
{
a = x;
b = y;
c = z;
}
public oops jiju(int x,int y )
{
a=x;
b=y;
}
public void oops(int x, int y, int z)
{
a = x;
b = y;
c = z;
}
my doubts are here: public Program(int x, int y)
{
a = x;
b = y;
}
what is the purpose of a,b in this code......
i am a beginner with out null programming backing thats why i have so many questions ...sorry for the trouble
thanks again
jiju
j
|
|
|
|
|
Trustapple wrote: i am a beginner with out null programming backing thats why i have so many questions
First of all, if you are so new to programming start reading about OOP (Object Oriented Programming)
Trustapple wrote: my doubts are here: public Program(int x, int y)
{
a = x;
b = y;
}
what is the purpose of a,b in this code......
As you may have noticed, the "function" Program has it's name the same as the class...that means it's a constructor. In your example you have 3 constructors. One with no parameters
public Program()
{
...
}
One with 2 parameters
public Program(int x, int y)
{
...
}
And one with 3 parameters. In the last 2 constructor you store the values received as parameters into local variables. When you have 3 constructors you can create an object of Program type like this
Program obj = new Program();
Program obj1 = new Program(1,2);
Program obj2 = new Program(1,2,3);
For more details about overloading constructors...try Google.
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Hi All,
I am writting a C# project in which am using Browser Control. The object of this project to read values of JavaScript's variables values on the current page ,and add those values to ListBox control. Can anybody show me how to do this. Please help if you can I need to do this ASAP for my job.
Thanks,
Asif
A.Asif
|
|
|
|
|
Hi...
A.Asif wrote: to read values of JavaScript's variables
directly you will not be able to read the values of javascript variables, but to get values the possible solution is to create hidden fields in you application and store the values of the javascript variables into these hidden fields and finally in your code access those hidden fields and add the values into listbox control.
Regards,
Sandeep Kumar.V
|
|
|
|
|
Thanks for your help! I do understand hidden field part, however, I am not good with JavaScript, Can you please tell me how to get values into these fields from javascript.
Thanks,
Asif.
|
|
|
|
|
here is the example....
<html><br />
<head><br />
<script language="javascript"><br />
function fun1()<br />
{<br />
var testvariable="testdata";<br />
document.forms[0].hid1.value = testvariable;<br />
}<br />
</script><br />
</head><br />
<body><br />
<form><br />
<input type="hidden" name="hid1" id="hid1"><br />
<input type="button" Name="but1" id="but1" onclick="fun1()><br />
</form><br />
</body><br />
</html>
Regards,
Sandeep Kumar.V
|
|
|
|
|
|
hi all.
I have a service with multi threads and i want to debug a specified thread but not have to wait the others. I'm a new newbie. Please help me with this problem. I've spent much time with it but get no result.
Many Thanks!
|
|
|
|
|
Hi!
Are your threads executing the same piece of code or are you using different threads for different tasks?
Anyway, if you attach VS to the service process and have a breakpoint at the appropriate position, it should work. In addition, you can make breakpoints conditional, so perhaps you can tell VS to break only for a given ThreadID...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I need a function that launches a text file in the users default text editor. It would be easy enough to launch notepad, but notepad is horrid. How to I grab the executable that is used for the .txt extension. I assume this is a registry thing, and I have avoided the registry in the past.
Thanks.
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
You use Process.Start and pass it the path to your txt file. It's probably going to open notepad.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hi, if you pass a .txt file as the command to Process.Start() it will be opened by
whatever app is associated to the .txt extension (which could be Notepad of course).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Both of you THANKS! and DUH on me.
Many users will have notepad, but I know the particular user I am dealing with uses textpad. I wanted it to just call whatever is associated.
Thanks again.
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
I'm so new to AD it's not even funny What I'm trying to do is export all the users and there information to my application and then use that information to create accounts in another app. First question, is the directory in XP the same as Server? I ask this because if I'm righting this app in XP can I test it there (again so new to AD)? Next, I have checked for some examples of how to do this but just don't understand the LDAP connection at all. Could anyone lead me to some very VERY simple examples that would work with XP? Even some books that you would recommend is good too. Thanks so much!
|
|
|
|