|
string s = "blablabla";<br />
s.Substring(0, 3);
|
|
|
|
|
System.DateTime.Now returns a date in this format "12/13/2006 4:34:00 PM"
I want it to display the date in this format "12/13/2006 16:34:00" instead.
I can see using GetDateTimeFormats that I need to use format number 74.
How do I do this?
|
|
|
|
|
|
System.DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Civic06 wrote: System.DateTime.Now returns a date in this format "12/13/2006 4:34:00 PM"
No, actually it doesn't.
It's a common misconception that a DateTime value has a specific format. It doesn't. It's when you convert the DateTime value into a string that it gets it's format.
If you don't specify any format when you convert it, it uses the format of the default culture. If you want a specific format, you have to specify that when you convert it.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi,
I have the following problem: I am selecting specific row using command:
datagridview.Rows[RowIndex].Selected = true;
Now, desired row is selected but how to scroll to it because it doesn't do it automatically.
Can somebody heeeeelp, please
Aleks
|
|
|
|
|
One method is to set the CurrentCell property:
datagridview.CurrentCell = datagridview.Rows[RowIndex].Cells[0];
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
O Gee, you 'r pure genious. I would never think of it that way.
Thaaaaanks a lot
|
|
|
|
|
Hi,
Is there a way to tell if a form is on top of all the other windows application. In another word, I want to know if the form covered by somthing or fully visible to user.
Thanks in advance for any suggestion!
Alan
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
One way to do this might be to get the form's Graphics.ClipRegion and compare it with the region for the entire form its bounds with that of the form. If they aren't equal, the form is partially occluded.
/ravi
-- modified at 16:35 Tuesday 12th December, 2006
|
|
|
|
|
|
I can't use SetValue in the normal way because I the name of the class is treated as a type, not an object to call a method on.
<br />
Type myType = typeof(MyStaticClass);<br />
myType.GetProperty(PropertyName).SetValue(MyStaticClass,newValue,null);<br />
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Pass in null . I wrote a quick example and it worked fine.
myType.GetProperty(PropertyName).SetValue(null, newValue, null);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Looks nicer than the InvokeMember call I found too.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Answer found with additional googling.
myType.InvokeMember(PropertyName, BindingFlags.SetProperty | BindingFlags.Default,null,null,new object[] {newValue);
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Hi guys,
I am trying to design a form with a button to drop the database tables and finally uninstall the application, i got the drop tables working but I have no idea on how to uninstall the application programmatically. Please help!!
sasa
|
|
|
|
|
When you install your application, it's automatically added to the Add/Remove control panel applet. The applet is actually calling the uninstaller that is supplied by you. To call that installer yourself:
Process.Start("MsiExec.exe /I{AC7DF146-BA42-4EC4-A90C-BC9FF970E7DF}");
Where that GUID is the Product Code property of your setup project. Note that you must close the exe file once the uninstall has started or make a custom action to do that for you.
Regards
|
|
|
|
|
Pardon my ignorance in this matter.
Can I use your above suggestion as follows;
System.Diagnostics.Process Proc = new System.Diagnostics.Process();
Proc.StartInfo.FileName = "MsiExec.exe /I{11111111-1111-1111-1111-111111111111}";
Proc.Start();
Also, what does /I stand for?
Thank you in advance.
sasa
|
|
|
|
|
It's impossible that your Product Code is that?!! To get your product code:
1- Open the solution explorer
2- Right Click on the name of the setup project => Properties
3- In the Property Grid look for Product Code property. Copy it.
4- Paste it in the code I supplied instead of my GUID.
SASA_1 wrote: Also, what does /I stand for?
The "/I" is a command line argument that is passed to Windows installer. It tells the installer if you wish to modify/repair/remove you applicatino. In this case it will tell the installer that you want to remove, but don't worry; The uninstallation doesn't do it automatically. It opens up normally as you'd have clicked on the Add/Remove icon.
PS.
Did you decide how to handle closing your active application? Uninstallation won't work until you close it.
Regards
|
|
|
|
|
My product code is {C53335FB-9BAA-4F41-A47C-0474249B089B} and this is what I have now for my code which doesn't work;
System.Diagnostics.Process.Start("msiexec.exe /i{C53335FB-9BAA-4F41-A47C-0474249B089B}");
this.Close();
I get an unhandled exception saying the system can't find the file specified....
Please advice
sasa
|
|
|
|
|
|
Well, You can use this instead:
Process Proc = new Process();
Proc.StartInfo = new ProcessStartInfo("MsiExec.exe", "/I{23959E96-A80F-4172-A655-210E9BB7BFBE}");
Proc.Start();
PS.
Again replace that GUID with yours.
Regards
|
|
|
|
|
if u want silent uninstallation, use /q.
|
|
|
|
|
Thank you much man, I really really appreciate your help. I put the code in the main of the form and got it to work.
sasa
|
|
|
|
|
Hi Everybody
I was just wondering if there is anyone who has got any experience in streaming sound using C# as well as processing it using DSP algorithms e.g. FFT, filtering...( in the same manner as done in Matlab). I would really appreciate all inputs especially since I have never done anything similar before… Maybe you know of some good articles/links or code examples...I would also like to know (if possible) what to prefer when streaming sound: C# or java...
Thanks a lot
AL
-- modified at 16:16 Tuesday 12th December, 2006
|
|
|
|