Method calling and parameters.

Sorry for the noobism, I'm not a programmer but a hobbyist, but I'm having trouble with a certain thing I'm trying to do that I can't seem to figure out via research.

I have Form1, and two classes (minus the form), Class1 and Class2. The form has a button that calls Class1.Method1, but Class1.Method1 takes parameters (not optional) from Class2.Method2. As such, I cannot do Class1.Method1(); in Form1 (overloading error), and I need to return a value from Class1.Method1 to use in Form1. Below is the skeleton of this:


Public class class1 { public static NetworkCredential Method1(string A, string B) { //Stuff that calls Class2.Method2 and uses our params Return stuff; } } 


public partial class Form1 : Form { private void Button1_Click(object sender, EventArgs e) { //This is where I'm stuck. How to call Class1.Method1 //and return stuff, but have Method1's parameters still //doing its thing with Class2.Method2? Class1.Method1(); } } 

Any help on this would be really appreciated.

by DoNotSexToThis via /r/csharp

Leave a Reply