|
Thanks.
I tryed some other methods but in the end i just use this function :
private void InsertThisStudent(Student std, List<Student> List)
{
for (int i = 0; i < List.Count; i++)
{
if (std.CompareTo(List[i]) < 0)
{
List.Insert(i, std);
return;
}
}
List.Add(std);
}
thanks
|
|
|
|
|
Hi,
I have developed an application in C# i have done the GUI interaction.
But i want to invoke the API's through CMD.Please gaide me how to do C# application through command line.
With Regards
Mahesh
|
|
|
|
|
maheesh wrote: But i want to invoke the API's through CMD
Invoke APIs? Do you want to start the application through command line? If yes, go to the application directory and type your executable name. If you need to pass additional parameters to the program, pass it after the executable name. Something like
yourexename.exe arg1 arg2 arg3
You can read these in the program's main method.
|
|
|
|
|
I need to pass the parametes like
1.Input file name and path selection
2.Output Folder path selection
Not to invoke the form application,i have genarated class library file of my application.
I want to invoke the dll through cmd
Please help me
With Regards
Mahesh
|
|
|
|
|
Do you mean that you want to call methods in your (GUI) application via Command line arguments?
In that case, just handle the arguments in your application's Main method before the Application.Run(...) call is made.
|
|
|
|
|
Not GUI application.
The main functionality of my application i made as class library.
I want to provide inputs to class Library through CMD.
GUI part i have done.
with Regards
Mahesh
|
|
|
|
|
Okay, then create a Console Application and add the DLL assembly as a reference and make calls to the methods in your DLL by passing on the command line arguments from the Main method.
|
|
|
|
|
Ive created a custom control which fires event, and it works fine when I drag the control onto a form, and In that form I can create the event handler.
But now im dynamically loading the control into the form during runtime(Assembly.LoadFrom etc.). So obviously below that creating code when I try say userCtrl.myEvent += new EventHandler(this.myHandler); it wont work.
I understand why it doesnt work, I just have no clue what to do.
Thanks
Strive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|
|
Why are you using Assembly.LoadFrom ? You can add control dynamically like this:
YourUserControlClass userCtrl = new YourUserControlClass();
userCtrl.myEvent += new EventHandler(this.myHandler);
this.Controls.Add(userCtrl);
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
By dynamically I mean totally dynamically. Like they browse and select a dll. So its not included in the solution before runtime.
Strive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|
|
In that case, EventInfo class will help you. See this[^] link.
Or this[^] one.
Hope it helps.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
i need to validate the Textboxes that are created at runtime. The text should not be blank and it should allow only numbers.
|
|
|
|
|
Use a MaskedTextBox[^] instead.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
maybe validate against a regex? ^\d+$
you could put it in the TextChange event handler method
eks.
private void textBox1_TextChanged(object sender, EventArgs e)
{
Regex r=new Regex(@"^\d+$");
Match m=r.Match(textBox1.text);
if(!m.Success) MessageBox.Show("Wrong input format");
}
or you could check the content of the textbox when it is submited, in the same fasion, using Regex and Match classes.
one idea is to make a class that inherits from the TextBox class, add a string attribute that can hold the regex expression, and use that class instead of the TextBox and store the regex in that variable, then you could just loop through all the controls when the user subits the data, an check it against the regex stored in that control, like this:
public class ExtTextBox:TextBox
{
public string ValidationRegEx;
}
....
ExtTextBox newETB=new ExtTextBox();
...
...
newETB.ValidationRegex=@"^\d+$";
...
this.Controls.add(newETB);
foreach(Control c in this.Controls)
{
if(c is ExtTextBox)
{
ExtTextBox tmpC=(ExtTextBox)c;
Regex r=new Regex(tmpC.ValidationRegex);
Match m=r.Match(tmpc.Text);
if(!m.Success)
{
}
}
}
modified on Wednesday, August 19, 2009 5:00 AM
|
|
|
|
|
Dear All:
Am trying to learn how to secure web application does any body knows resources that are really helpfull?? I read an article her in CodeProject that talks about basePages and how they inherit each other to authenticate what is good is that i already work with this methodology but i did not know that this way was a really good one, but as you all know we developers can't get enough so any one could help?????
Thanks
|
|
|
|
|
khalil.kamel wrote: Am trying to learn how to secure web application
IMO, this is subjective. Here[^] is a MSDN technet article which talks about some general techniques. You may be interested in this[^] wiki as well.
|
|
|
|
|
Ok thanks but am searching for this kind of article please check it it is really niceCodeProject Article
these kind of articles that would make a developer better that others and this is what am searching for
|
|
|
|
|
hi all,
i have a datagridview, i want to check cell value in CellEndEdit event. if the cell is empty, don't allow to leave it.
how can i do it?
|
|
|
|
|
set property
CauseValidation = true;
in CellValidating() event handler
dtGrdView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
here e will provide you the data entered in the data grid view
if (e.ColumnIndex > 0)
{
e.Cancel = true;
}
}
thats it!!
reg,
Deep
Happy Coding
modified on Wednesday, August 19, 2009 5:24 AM
|
|
|
|
|
thanks for Your answer, but
(i want check blank cells, when it's edit && now leaved)
when i check blank cell into if statement (for example if(datagrid[x,y].value.ToString()=="")) the cell value is the previous value
and it is True, only the cell is already empty.
What is the solution?
|
|
|
|
|
HI all,
i m using SmsSendMessage api for sending sms , its working fine .
i have one problem its still working when mobile have no sufficient balance for sending sms,in that case i want when mobile have no sufficient balance for sending sms than it display a message for balance enquiry and stop the message sending process.
please tell me how can i check the balance of mobile phone with codeing.
if possible please explain me with any example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
This question has nothing to do with any sort of standard API offered by Microsoft in the .NET framework. So, you need to look at the library you are using, and see if it offers the functionality you need.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Oh. you're using the compact framework. Why didn't you say so ? What have you done to try to find APIs that check if a phone still has credits ? I would be surprised if such a thing existed.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
actully i m inserting this exe in Windows based mobile and send sms tru this exe.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|