|
I get all running processes on the computer
how i can bring a selected process to front if it has an interface using c#?
|
|
|
|
|
|
hi everyone, when we write a program in the any programing languages he result of the compiling process is an executable file (.exe) how we can change this result ?
we can do this ?
if not what we can do to have a different result type ? ( like writing a converter program that converts the executable result of the main program to another result and .... )
thanks to you all
|
|
|
|
|
ariyanna wrote: hi everyone, when we write a program in the any programing languages he result of the compiling process is an executable file (.exe) how we can change this result ?
What result are you expecting from complier ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
something like picture format or something else,
I'm talking about a picture that can be executable !
|
|
|
|
|
ariyanna wrote: I'm talking about a picture that can be executable
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
This is too close to being dangerous (aka virus creating)
I don't think you'll get an answer here.
|
|
|
|
|
ariyanna wrote: how we can change this result ?
It completely backs to your compiler. If you're writing C#, the compiler compiles your codes into MSIL (I think), If you're using Java, you have Byte Code after compiling. (Or I couldn't understand you well)
ariyanna wrote: we can do this ?
I don't think so. There's some converters by the way.
|
|
|
|
|
tanks to you all,
i don't think that i can get my answer here but if any one can introduce some sources for this subject i'll be glad...
|
|
|
|
|
Hi,
I have One DataGridView and One Button In Form.
I Form Load I Have Assigned DataSource To Datagridview by calling one function abc().
on button click i am adding search condtion to my select query.
abc function performs...
i am counting number of records Returned from the select query if it is not zero then i am assigning datasource........
now i want to clear the datagridview when no of records is zero.
how can we do this.
thanks in advance
|
|
|
|
|
set DataSource property of DataGridView to null
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Hi,
I was not sure where to list this so please excuse me if I have created this post in the wrong place.
I have a simple question, when will you employ the Facade Pattern? I mean I have checked it out and it's an excellent pattern but if you have say 10 classes and each class has 1000 methods why would you employ the Facade pattern? It seems to me that you are literally creating a single point of failure for your application.
It's probably a dumb question but I would like to know as this pattern seems like an excellent pattern to me but like ASP.NET AJAX, if you use it in the wrong place it will break your app - not make it better.
Illegal Operation
|
|
|
|
|
Illegal Operation wrote: I mean I have checked it out and it's an excellent pattern
If you checked it out and decided it is an excellent pattern, surely you must have read where and why you would use it?
Illegal Operation wrote: if you have say 10 classes and each class has 1000 methods
Then you have a bigger problem that the Façade pattern will solve.
Illegal Operation wrote: It seems to me that you are literally creating a single point of failure for your application.
I don't understand what you are meaning by that. How is the Façade pattern a single point of failure?
There are various areas where you might use the Façade pattern. Most likely is that you have a large and unweildy interface into some subsystem and you want to create an easy interface to that system that hides some/most of the detail.
For example, a DAL (Data Access Layer) could implement the Façade pattern to hide the detail of ADO.NET operations. To the outside application you have a method that returns, say, customers. Behind the scenes the Façade is creating connections and SQL commands and so on. Now your main application doesn't have to deal with that detail any more. This makes your application cleaner to use and easier to maintain. And there is always the option to change what is behind the Façade without disturbing what is using the Façade (e.g. some time some decides that you really don't need SQL Server and that a bunch of XML files would be much better - Just think of all the code you'd have to change without the Façade. Now you change code in one place and everything else stays the same)
|
|
|
|
|
If there is something wrong with my original reply then let me know. Is there something I need to clarify? Is something I've not understood? Did I not answer the question? Let me know so I can be helpful. Voting it a 1* isn't helpful to anyone. It doesn't tell me why it isn't a good answer.
|
|
|
|
|
The Design and Architecture[^] section would be the best place for this question.
As Colin has pointed out, the Facade pattern is a great way to hide complexity. Basically, you use the facade to hide the detail of how multiple related operations are performed, so you introduce simplicity into your design.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi,
i used an object of date time and to be sure i fill it by hard code
and i tried to change it by add functions like AddYears() and the others
but it don't change i don't know where is the problem
i send two part of code the first one is the related code and the second is the whole
i appreciate your attention
the related code :
DateTime myDateTime = new DateTime(2007, 1, 1, 1, 1, 1);
MessageBox.Show("before:" + myDateTime.ToString());
myDateTime.AddDays(6);
myDateTime.AddYears(1);
myDateTime.AddMonths(4);
MessageBox.Show("after:" + myDateTime.ToString());
the whole function is :
private void settings_Load(object sender, EventArgs e)
{
myButtonClass1.dayOfWeek = 1;
myButtonClass2.dayOfWeek = 2;
myButtonClass3.dayOfWeek = 3;
myButtonClass4.dayOfWeek = 4;
myButtonClass5.dayOfWeek = 5;
myButtonClass6.dayOfWeek = 6;
myButtonClass7.dayOfWeek = 7;
myButtonClass8.dayOfWeek = 8;
myButtonClass9.dayOfWeek = 9;
myButtonClass10.dayOfWeek = 10;
myButtonClass11.dayOfWeek = 11;
myButtonClass12.dayOfWeek = 12;
myButtonClass13.dayOfWeek = 13;
myButtonClass14.dayOfWeek = 14;
myButtonClass15.dayOfWeek = 15;
myButtonClass16.dayOfWeek = 16;
myButtonClass17.dayOfWeek = 17;
myButtonClass18.dayOfWeek = 18;
myButtonClass19.dayOfWeek = 19;
myButtonClass20.dayOfWeek = 20;
myButtonClass21.dayOfWeek = 21;
myButtonClass22.dayOfWeek = 22;
myButtonClass23.dayOfWeek = 23;
myButtonClass24.dayOfWeek = 24;
myButtonClass25.dayOfWeek = 25;
myButtonClass26.dayOfWeek = 26;
myButtonClass27.dayOfWeek = 27;
myButtonClass28.dayOfWeek = 28;
myButtonClass29.dayOfWeek = 29;
myButtonClass30.dayOfWeek = 30;
myButtonClass31.dayOfWeek = 31;
myButtonClass32.dayOfWeek = 32;
myButtonClass33.dayOfWeek = 33;
myButtonClass34.dayOfWeek = 34;
myButtonClass35.dayOfWeek = 35;
myButtonClass36.dayOfWeek = 36;
myButtonClass37.dayOfWeek = 37;
myButtonClass38.dayOfWeek = 38;
myButtonClass39.dayOfWeek = 39;
myButtonClass40.dayOfWeek = 40;
myButtonClass41.dayOfWeek = 41;
myButtonClass42.dayOfWeek = 42;
Persian = new MyDateTime();
myPC = new PersianCalendar();
myHC = new HijriCalendar();
DateTime myDateTime = new DateTime(2007, 1, 1, 1, 1, 1);
String s;
s = "Shamsi: ";
s += myPC.GetDayOfMonth(myDateTime).ToString();
s += "-" + myPC.GetMonth(myDateTime).ToString();
s += "-" + myPC.GetYear(myDateTime).ToString();
s += "-" + myPC.GetDayOfWeek(myDateTime).ToString();
day.Value = myPC.GetDayOfMonth(myDateTime);
month.Value = myPC.GetMonth(myDateTime);
year.Value = myPC.GetYear(myDateTime) % 100;
Qday.Value = myHC.GetDayOfMonth(myDateTime);
Qmonth.Value = myHC.GetMonth(myDateTime);
Qyear.Value = myHC.GetYear(myDateTime) % 100;
Mday.Value = myDateTime.Day;
Mmonth.Value = myDateTime.Month;
Myear.Value = myDateTime.Year % 100;
s += "\n";
s += "Miladi:";
s += DateTime.Now.ToString() + "\n";
output.Text = s;
Persian.Year = (ushort) myPC.GetYear(myDateTime);
Persian.Month = (ushort)myPC.GetMonth(myDateTime);
Persian.Day = (ushort)myPC.GetDayOfMonth(myDateTime);
Persian.Hour = (ushort) myPC.GetHour(myDateTime);
Persian.Minute = (ushort) myPC.GetMinute(myDateTime);
Persian.Second = (ushort) myPC.GetSecond(myDateTime);
Persian.Milisecond = (ushort) myPC.GetMilliseconds(myDateTime);
second.Value = DateTime.Now.Second;
minute.Value = DateTime.Now.Minute;
hour.Value = DateTime.Now.Hour;
string Date = "";
Date += Persian.Day.ToString();
Date += " / ";
switch (Persian.Month)
{
case 1:
Date += "فروردين";
break;
case 2:
Date += "ارديبهشت";
break;
case 3:
Date += "خرداد";
break;
case 4:
Date += "تير";
break;
case 5:
Date += "مرداد";
break;
case 6:
Date += "شهريور";
break;
case 7:
Date += "مهر";
break;
case 8:
Date += "آبان";
break;
case 9:
Date += "آذر";
break;
case 10:
Date += "دي";
break;
case 11:
Date += "بهمن";
break;
case 12:
Date += "اسفند";
break;
}
Date += " / ";
Date += Persian.Year.ToString();
date.Text = Date;
MessageBox.Show("before:" + myDateTime.ToString());
myDateTime.AddDays(6);
myDateTime.AddYears(1);
myDateTime.AddMonths(4);
MessageBox.Show("after:" + myDateTime.ToString());
}
|
|
|
|
|
I suggest you get someone who is an englsh speaker to help rephrase your question - it did not make sense to me. I even read through your code hoping it would throw a ligh on your problem - what a mess.
Take a look at cultureinfo.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
According to the .Net Documentation of AddYears:
"This method does not change the value of this DateTime. Instead, a new DateTime is returned whose value is the result of this operation."
|
|
|
|
|
DateTime is immutable - it can't change. AddDays and the other functions return a new DateTime with the new value.
You should do
myDateTime = myDateTime.AddDays(6);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
DateTime.AddXXX creates a new DateTime object with the added value.
Use this:
DateTime myDateTime = new DateTime(2007, 1, 1, 1, 1, 1);
MessageBox.Show("before:" + myDateTime.ToString());
myDateTime = myDateTime.AddDays(6);
myDateTime = myDateTime.AddYears(1);
myDateTime = myDateTime.AddMonths(4);
MessageBox.Show("after:" + myDateTime.ToString());
|
|
|
|
|
Hey.
I've been searching relentlessly via the web for a solution to converting pcl files to pdf, but every SDK I've found requires payment and at no cheap cost so I now beg assistance via this forum.
I'm writing a Sharepoint activity that will convert pcl files to pdf.
Any assistance as to a solution would be greatly appreciated.
A dll or an sdk would be of great help.
Thanks in advance, Marco
|
|
|
|
|
Dear,
i have 10 questions in a form each question have 4 option.
i made 10 group box for each question and putted 4 radio button into each.
finally i have to calculate score of this test using a answer key.
what is the process for this .
(i am checking 40 radio button individually)
but it is not good if we have 100 question.
is there any solution ?....
thanks
|
|
|
|
|
Create a custom control to service a question. It needs to receive a question object, bind the controls to the object and bind the response to the answer in the object. When completed the object should write the result back to the database.
Then you just create one CC for each question and put it on the form. I would use a flowcontrol in winforms.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes sure. As Mr. Holmes said, you can have a CC for your questions but not a CC for each one. You can have a CC for all your questions. If I were you, my CC would have a Label and 4 RadioButtons in it and I would set their values with my CC constructor, something like this:
public myCC (string LabelValue, string[4] questions)
{
labelQuestion.Text = LabelValue;
radiobuttonQuestions.Texts = questions;
}
And everytime user clicks on Next button (or something similar) store the result in an array, create a new CC, set its values, show on your form and dispose the previous one. Your memory can breathe in this way
I hope I could help
I learned something new today
|
|
|
|
|
Hi,
I am using ODBC connection to execute a Stored procedure inside my C# project (visual studio 2008). I am passing a parameter and it is working fine except fewer parameter values. I tried to replace the SP by the exact query (used inside the SP) and it is working fine for all the parameter values. I dont understand why. Any one came across this problem? i cant find any forums relatd to this particular situation.
I got stuck here for more than 4 days now. Any help is highly appreciated.
Thanks a lot
Renu
|
|
|
|