Click here to Skip to main content
15,916,378 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to call default text editor Pin
Christian Graus16-Aug-05 13:59
protectorChristian Graus16-Aug-05 13:59 
AnswerRe: How to call default text editor Pin
thealca16-Aug-05 14:04
thealca16-Aug-05 14:04 
AnswerRe: How to call default text editor Pin
Mohamad Al Husseiny16-Aug-05 14:46
Mohamad Al Husseiny16-Aug-05 14:46 
AnswerRe: How to call default text editor Pin
therealmccoy16-Aug-05 19:16
therealmccoy16-Aug-05 19:16 
GeneralButton control and images Pin
Liunardu16-Aug-05 9:39
Liunardu16-Aug-05 9:39 
GeneralRe: Button control and images Pin
Mohamad Al Husseiny16-Aug-05 9:55
Mohamad Al Husseiny16-Aug-05 9:55 
GeneralSum of each column in a datagrid Pin
Srinivas Jonnalagadda16-Aug-05 8:21
Srinivas Jonnalagadda16-Aug-05 8:21 
GeneralTeam programming Pin
Genbox16-Aug-05 7:36
Genbox16-Aug-05 7:36 
Hi.

My friend and I are very new to C#, we would like to start a project in C# together.
We have Team foundation server 2005 beta2 from microsoft, but can't install it because of known issues.
Until the final is released, we decided to continue without it.

We created a ASP.Net webpage where he edits the frontend (site.aspx) and backend (site.aspx.cs) while i have added a new page to the project called newstuff.cs (in a subfolder called App_code)

If i make a method called CalculateDistance(), how do i include it in the main project page (site.aspx.cs) ?

I have some code like this:

<br />
using System.Net;<br />
using System.Runtime.InteropServices;<br />
[DllImport("iphlpapi.dll", ExactSpelling = true)]<br />
public static extern int SendARP(int DestIP, int SrcIP, [Out] byte[] pMacAddr, ref int PhyAddrLen);<br />
<br />
        String LocalHostName = Dns.GetHostName();<br />
        string[] Ipaddr = new string[3];<br />
        Ipaddr[0] = LocalHostName;<br />
        System.Net.IPHostEntry LocalIpAddress = Dns.GetHostEntry(LocalHostName);<br />
        System.Net.IPAddress[] FirstAddress = LocalIpAddress.AddressList;<br />
        foreach (IPAddress TempA in FirstAddress)<br />
        {<br />
            Ipaddr[1] = TempA.ToString();<br />
            byte[] ab = new byte[6];<br />
            int len = ab.Length;<br />
            int r = SendARP((int)TempA.Address, 0, ab, ref len);<br />
            Ipaddr[2] = BitConverter.ToString(ab, 0, 6);<br />
        }<br />


How do i "convert" that to a method and return the value if Ipaddr[2] correctly ?

like this?:

public arp()<br />
{<br />
<br />
=code=<br />
<br />
return Ipaddr[2];<br />
}


and how do i access the method in the main project file (site.aspx.cs) ?
I'm sorry to ask so many questions and answer partally on some of them. Unsure | :~
GeneralRe: Team programming Pin
Colin Angus Mackay16-Aug-05 11:37
Colin Angus Mackay16-Aug-05 11:37 
GeneralRe: Team programming Pin
Anonymous16-Aug-05 20:16
Anonymous16-Aug-05 20:16 
GeneralRe: Team programming Pin
Genbox16-Aug-05 20:42
Genbox16-Aug-05 20:42 
GeneralDataGrid Sort Pin
Alomgir Miah16-Aug-05 7:33
Alomgir Miah16-Aug-05 7:33 
Generaldisable tab control page Pin
mhmo16-Aug-05 7:19
mhmo16-Aug-05 7:19 
GeneralRe: disable tab control page Pin
Mohamad Al Husseiny16-Aug-05 7:41
Mohamad Al Husseiny16-Aug-05 7:41 
GeneralAxWebBrowser - IHTMLSelectElement problem Pin
Romb16-Aug-05 7:18
Romb16-Aug-05 7:18 
Generallogin authentication Help needed Pin
ashkitt16-Aug-05 7:09
ashkitt16-Aug-05 7:09 
GeneralRe: login authentication Help needed Pin
Mohamad Al Husseiny16-Aug-05 9:46
Mohamad Al Husseiny16-Aug-05 9:46 
GeneralRe: login authentication Help needed Pin
ashkitt16-Aug-05 19:30
ashkitt16-Aug-05 19:30 
Questionplease help! this is urgent> how to retrieve data to my tabpage without using data form wizard? Pin
nidhelp16-Aug-05 6:59
nidhelp16-Aug-05 6:59 
AnswerRe: please help! this is urgent&gt; how to retrieve data to my tabpage without using data form wizard? Pin
Mohamad Al Husseiny16-Aug-05 7:19
Mohamad Al Husseiny16-Aug-05 7:19 
GeneralRe: please help! this is urgent&gt; how to retrieve data to my tabpage without using data form wizard? Pin
nidhelp16-Aug-05 7:41
nidhelp16-Aug-05 7:41 
GeneralRe: please help! this is urgent> how to retrieve data to my tabpage without using data form wizard? Pin
Mohamad Al Husseiny16-Aug-05 9:26
Mohamad Al Husseiny16-Aug-05 9:26 
GeneralRe: please help! this is urgent&gt; how to retrieve data to my tabpage without using data form wizard? Pin
nidhelp16-Aug-05 17:43
nidhelp16-Aug-05 17:43 
GeneralDataSet Pin
samoore16-Aug-05 5:37
samoore16-Aug-05 5:37 
GeneralRe: DataSet Pin
Alomgir Miah16-Aug-05 6:11
Alomgir Miah16-Aug-05 6:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.