|
I doubt there is one but you are welcome to build your own and ask here if you have any questions
|
|
|
|
|
www.techipost.com/opensource-ludo-game-c-csharp/
|
|
|
|
|
|
for: break
do: break
while: break
if: no keyword to exit
read a book on C# !
|
|
|
|
|
i guess there is a return;
for example,
if(x<3)
return;
try it
|
|
|
|
|
break to exit from for.
There is nothing to break out of if since it is not a loop but a conditional directive.
|
|
|
|
|
Hi,
What is the best way to plot graphs in C# ?
Can crystal reports in VS 2005 be used for the same ?
Thanks in Advance
|
|
|
|
|
hi all,
i'm using hash table which has one key and one value, but i need to get two keys and one values now,
is there is any collection available for this, suggest me
thnks in advance
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
why don't you concatenate both keys using some special character delimiter and use them as a single key.
Regards
Shajeel
|
|
|
|
|
Try creating a collection of collections, this can be used to do what you want.
There is no "standard" multi-key collection class, and I think this is because its easy and valid to implement your own.
|
|
|
|
|
I have a class, let us say Customer which has a set of properties. I am using this class that is in a common dll in two different services (say Service1,Service2). Now i have a windows application (say WinApplication1)where i am adding reference to both the Services. So i have access to the Customer object in two differenct ways.
1) WinApplication1.Service1.Customer
2) WinApplication1.Service2.Customer
In my application i want to get a customer object from this service and pass it into the other service as an input. But i am getting casting problem.
It says "Cannot implicitly convert type WinApplication1.Service1.Customer to WinApplication1.Service2.Customer"
Please let me know if there is a easy way to do this conversion?
Srivatsan
|
|
|
|
|
You appear to have defined Customer twice. Once in each service. You should place Customer in its own Class Library project and then reference it from any other project that needs it. Assuming Customer is identical in each of the existing projects this should work fairly easily. However, if Customer in each of the existing projects, is the same in name only then you have a lot of work ahead of you to redesign your application.
|
|
|
|
|
The Customer Object is in a separate class library project only. I have referenced it in both the services. Now my win application is consuming both the service. Now i am getting the Customer object as an output of Service1 that has a datatype of Service1.Customer and when i try to pass it as an input to one of the methods in Service two that expects Service2.Customer, I am not able to do it.
The contents of the object Customer are the same.
Now what to do?
Srivatsan
-- modified at 7:00 Monday 9th April, 2007
|
|
|
|
|
I'm confused. You now appear to have 3 definitions for a Customer object. You should only have one throughout your entire solution.
You should be using only the customer object in the class library. You need to remove the definitions of Customer in the Services and use the Customer class in the class library instead. You can add the class library as a reference to each project that needs it. You can do that by right-clicking the project and selecting "Add Reference..." and going to the projects tab and choosing the class library project that contains the Customer class.
|
|
|
|
|
Hey i am doing as you are telling only. There are no multiple copies of the class. It is there in the common project(separate class library). But when you use the class by adding reference to the services then the wsdl of each and every service since it is in a different namespace will consider the same class as two different class files.
Srivatsan
|
|
|
|
|
Hi..
I m developing a C# compiler for which i have a utility package.
That package has lots of funtions.
i want to call those functions without an object. and i don't want
those functions to be static.
how can i achieve this..
plz help me.
regards,
nas
|
|
|
|
|
why you want to cancel the (static) option ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
becaus i want to call the function directly
as:-
.....
func1();
.....
and not as:-
.....
className.func1();
.....
as we cal function in C..
|
|
|
|
|
maybe iam wrong, but i don't think that is possible.
if you wrote a function on a class A and you want to access it
from another class B then you cannot access it regardless class A.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
anyway thanx for reply..
i hav another doubt..
i want to include a file, similarly as of #include.
only i want to copy the code at the position where i call the function IncludeFile().
|
|
|
|
|
could you be more specific, i didn't understand the new question..
nasambur wrote: only i want to copy the code at the position where i call the function IncludeFile().
this is not a professional way to do it , suppose you that you will
use that code again, what will happen ?? you will copy the code again ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
hmm. u r right..
i dont know exactly what happens behind when we use the 'using' in C#.
plz explain me..
|
|
|
|
|
please Rewrite your question in order to understand your problem.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Actually, we are developing an application to test the User Load for any Website..
below is the script of our tool that loads virtual user and tests the site..
using System;
using RTGWebLoad;
namespace Coolgoose
{
public class Transaction
{
private string username;
private string password;
public void TransactionMain(RTGHttpBrowser wlHttp, string ThreadNum, long RoundNum, long MaxRounds)
{
wlHttp.BeginTransaction("Coolgoose_SendingMail");
CallCoolGooseSendMail(wlHttp, ThreadNum, RoundNum, MaxRounds);
wlHttp.EndTransaction("Coolgoose_SendingMail");
}
public void CallCoolGooseSendMail(RTGHttpBrowser wlHttp, string ThreadNum, long RoundNum, long MaxRounds)
{
if (RoundNum == 1)
CGLogin(wlHttp);
CGSM(wlHttp);
}
public void CGLogin(RTGHttpBrowser wlHttp)
{
string[] loginData = wlHttp.GetData("http://10.80.4.43/?get=userpass", ',');
username = loginData[0];
password = loginData[1];
wlHttp.Get("http://www.cooltoad.com");
wlHttp.InfoMessage("Page1: " + wlHttp.wlSource);
wlHttp.Get("http://www.cooltoad.com/go/email");
wlHttp.Get("http://www.cooltoad.com/account/login.php?mail=1");
wlHttp.ContentType = "application/x-www-form-urlencoded";
wlHttp.FormData("ACCOUNT", username);
wlHttp.FormData("PASSWORD", password);
wlHttp.Post("http://www.cooltoad.com/account/login.php?mail=1");
wlHttp.Get("http://www.cooltoad.com/common/header_email.php");
wlHttp.Get("http://as03.cooltoad.com/go/desktop?p=folders");
wlHttp.Get("http://as03.cooltoad.com/go/desktop?o=folder:inbox");
wlHttp.InfoMessage("------" + username + " logged IN ------");
}
public void CGSM(RTGHttpBrowser wlHttp)
{
wlHttp.Get("http://as03.cooltoad.com/go/desktop?c=new");
string sCompose = wlHttp.FindString(wlHttp.wlSource, "COMPOSE\" VALUE=\"", "\">");
wlHttp.ContentType = "multipart/form-data";
wlHttp.FormData("TO", "xyz@gmail.com");
wlHttp.FormData("CC", "");
wlHttp.FormData("SUBJECT", "Testing LTT -- Naveed");
wlHttp.FormData("ATTACHMENT_DATA.wlFile-Name", "");
wlHttp.FormData("ATTACHMENT_DATA.wlContent-Type", "application/octet-stream");
wlHttp.FormData("MESSAGE", "Testing LoadTestingTool");
wlHttp.FormData("TZO", "-330");
wlHttp.FormData("C:SEND:::NEW.x", "12");
wlHttp.FormData("C:SEND:::NEW.y", "9");
wlHttp.FormData("COMPOSE", sCompose);
wlHttp.Post("http://as03.cooltoad.com/go/desktop");
wlHttp.InfoMessage("Compose: " + sCompose + " --- " + username);
}
public void CGLogout(RTGHttpBrowser wlHttp)
{
wlHttp.Get("http://as03.cooltoad.com/go/desktop?c=logout");
wlHttp.ClearCookies();
wlHttp.InfoMessage("------" + username + " logged OUT ------");
}
}
}
after writing this script we wil pass this to our Testing tool, which compiles this C# script and starts the run.
we want to tune our code, so that we can write this script in more better way..
currently the InfoMessage() functions are in the same package RTGWebLoad..
we want to move it to another package and can be called without an object or class name..
one of my mate suggest me to include the package's code as we do in C (using #include).
regards,
nas
|
|
|
|
|
Your mate is thinking the wrong way for C#.
You can wrap this code in to a class library of its own. Then you can reference the class library from where it is needed, if it is needed in multiple projects.
|
|
|
|