|
-
Aug 21st, 2002, 02:09 AM
#1
referencing a dll
i am able to use this in an exe, or even compile it as a dll, but I am not able to use it in other projects.
any clues?
regards,
abhijit
Code:
namespace StrClass
{
/*
* My First Class with C#.
* I could not find a function to reverse a string in c#
* strReverse is only present in VB.NET so I wrote one myself.
* -Abhijit
*/
public class StrReverse
{
public string strReverse(string sInput)
{
//Function To Reverse a string
char[] c;
c = sInput.ToCharArray();
string revstring = " ";
for(int i = c.Length;i != 0;i--)
{
revstring = revstring + c[i-1].ToString();
}
return revstring;
}
}
}
/*
namespace testApp
{
class mainapp
{
public static void Main()
{
StrClass.StrReverse a = new StrClass.StrReverse();
string zzz = a.strReverse("Cool");
Console.WriteLine("{0}",zzz);
}
}
}
*/
-
Aug 21st, 2002, 04:11 AM
#2
I think its do with the names that I am using. I used the following and it has worked correctly. Any comments please?
Code:
using System;
namespace bbb
{
/*
* My First Class with C#.
* I could not find a function to reverse a string in c#
* strReverse is only present in VB.NET so I wrote one myself.
* -Abhijit
*/
public class zzz
{
public string abc(string sInput)
{
//Function To Reverse a string
char[] c;
c = sInput.ToCharArray();
string revstring = " ";
for(int i = c.Length;i != 0;i--)
{
revstring = revstring + c[i-1].ToString();
}
return revstring;
}
}
}
/*
namespace testApp
{
class mainapp
{
public static void Main()
{
StrClass.StrReverse a = new StrClass.StrReverse();
string zzz = a.strReverse("Cool");
Console.WriteLine("{0}",zzz);
}
}
}
*/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|