|
is it "tongue in cheek" humor?
Note: it's not a question whether it's humor or not, but a question to check if I'm using the right expression!
(Still learning English, I am!)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
i already send mail by programmatically(C#)but i cant receive mail.i am developing a software like Microsoft out look express.
Any help will be highly appreciated.
|
|
|
|
|
|
I am using the ListView in detaisl mode has 6 columns, and able to add the rows (items) to it. Now I want search the column1 for the perticular text.
|
|
|
|
|
You really should read the full documentation for controls, before posting a question.
From MSDN: How to add Search Capabilities to a ListView[^].
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I need some help in finding the best way to stream the content of an XML file to a HttpWebRequest. This needs to be streamed as the xml contains a Base64 Encoded zip file. The XML is encoded using UTF-8 if this makes a difference? Previously I was just using
byte[] byteData = Encoding.UTF8.GetBytes(requestInfo.XML);
but this was under some circumstances causing me a OutOfMemory exception. I cant send the actual file so cant stream the file. What is the best way to stream the UTF8 xml data to the HttpWebRequest.
Thanks
Stu
|
|
|
|
|
Hi
I am trying to get data from several dynamics datagridview. The grids are on a tabbed pages. I have set the form and the tab control to public
frmTeacherApp teachApp;
private void btnSave_Click(object sender, EventArgs e)
{
teachApp = new frmTeacherApp();
foreach (Control ctl in teachApp.Controls)
{
//Finding the datagridgrids from a global ArrayList i put the grid
//names in
}
}
but not work. Also try to put the grid into public System.ComponentModel.Container with same result.
Can someone help me?
Regards
Rune, Norway
|
|
|
|
|
If the DatagridView is bound and the "another form" opens from the form having these grids, you can send the datasource of the grids through a parameterized constructor.
|
|
|
|
|
The DataViewGrid is bound to a DataTable also generatet dynamically. I will try it. Thank you so fare
Rune
|
|
|
|
|
Greetings,
I am facing a problem with C#
I have a set of files that I want to replace any number that has -9999.**** (like -9999.1234 or any number that can be after the dot .) to be -9999.0000.
I have written a code that will put find any number that starts with -9999. However, I don't know how to replace it to be -9999.0000 . (the problem is finding and replacing the numbers after the . to be 0000)
If anybody can help me, that will be highly appreciated.
Thanks in advance.
Regards,
|
|
|
|
|
If you simply want to round nnn.xxx down to nnn.0, then you need to use Math.Floor. If that doesn't work then look at Math.Ceiling - I'm not certain which way round it works with negative numbers
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thank you for your reply.
But what I am trying to say is that I have a text file that has many number that begins with (let say -9999.) and the numbers have four digits after (like 1234 [any four digital number]).
What I want to do is that to replace any number that is after the . (like in -9999.1234 [which will be 1234])to be -9999.0000 ( the four digital after the . to be 0000).
In short, search the file for -9999.**** to be replaced to -9999.0000
Note:
* means any number.
Regards,
|
|
|
|
|
Is this a CSV file?
I would say use File.ReadAllLines and then use Regular Expressions to find the decimal numbers. Then using the Matches collection you can replace digits.
You can also use String.Replace method alone to do this.
|
|
|
|
|
Thanks...
the problem I am facing is that how can I make the code to replace any number (not specify number) with a specify number.
for example,
I have these numbers in the file:
-9999.1234
-9999.2345
-4021.0101
-9999.0987
-9999.7654
-7892.4132
-9999.0393
and etc...
I want any number that has -9999. (like -9999.1234, -9999.2345 and etc...) to be replaced with -9999.0000
I want a code that can do that in C#.
Note:
I wrote a code to read from the file and put each line in a array of type string.
What I want is that a code to replace any number that has -9999. (like -9999.1234, -9999.2345 and etc...) with -9999.0000
Regards,
|
|
|
|
|
Quick and dirty way:
string sFile = System.IO.File.ReadAllText(@"c:\test.txt");
string sRegEx = @"(\.[0-9][0-9][0-9][0-9])";
foreach (Match oMatch in Regex.Matches(sFile, sRegEx)) {
sFile = sFile.Replace(oMatch.Value.ToString(), ".0000");
}
System.IO.File.WriteAllText(@"c:\test.txt", sFile);
I would suggest you to search for a better Regular expression since, here I have hardcoded the number of digits after decimal.
|
|
|
|
|
d@nish wrote: string sRegEx = @"(\.[0-9][0-9][0-9][0-9])";
you can write
string sRegEx = @"(\.[0-9]{4})";
himanshu
|
|
|
|
|
Or better:
string sFile = System.IO.File.ReadAllText(@"c:\test.txt");
Regex r = new Regex(@"(\.[0-9][0-9][0-9][0-9])");
sFile = r.Replace(sFile, ".0000");
System.IO.File.WriteAllText(@"c:\test.txt", sFile);
He still needs to find a better regex though!
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
|
|
|
|
|
Hi,
Do you need to know the fractional part of the number or will a simple text replacement suffice?
i.e.
If string starts with "-9999." then
string = "-9999.0000"
Alan.
|
|
|
|
|
The following regex finds all numbers that conform to the pattern -9.9999, where the first part can have any number of digits (and can be a positive or negative integer), but the part after the period is constrained to 4 digits.
Regex regex = new Regex(
@"(((?<Start>-?)(?<Part>\d*))(\.\d{4}))",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled
); You can then do a replace on this using the pattern:
${Start}${Part}.0000 This version of the code prevents you from incorrectly grabbing items such as A.1234 or the like.
[Edit]Modified because I didn't have Encode HTML tags when pasting set, and the group tags were hidden
"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
modified on Tuesday, July 7, 2009 6:44 AM
|
|
|
|
|
Pete O'Hanlon wrote: Regex regex = new Regex( @"(((?-?)(?\d*))(\.\d{4}))", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled );
"parsing "(((?-?)(?\d*))(\.\d{4}))" - Unrecognized grouping construct."
This is the exception while using your regex.
|
|
|
|
|
See the modification above. I didn't have "Encode HTML tags when pasting" set, so the group tags were hidden
"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
|
|
|
|
|
Pete O'Hanlon wrote: This version of the code prevents you from incorrectly grabbing items such as A.1234 or the like.
Um, no it doesn't - you need to replace the '*' with a '+' or it matches 0 digits.
Regex regex = new Regex( @"(((?<Start>-?)(?<Part>\d+))(\.\d{4}))",
RegexOptions.IgnoreCase |
RegexOptions.Multiline |
RegexOptions.IgnorePatternWhitespace |
RegexOptions.Compiled );
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
|
|
|
|
|
OriginalGriff wrote: Um, no it doesn't - you need to replace the '*' with a '+' or it matches 0 digits.
Good spot.
"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
|
|
|
|
|
when i waz doing some project.......it asks user password....in zat page u can also change ur password..........but i just want to increase z size of z form and add some buttons.....i already create z button @ run time but it is not visible.....and i cant locate z location of z button....hw could i solve it???
|
|
|
|
|
Obviously English isn't your first language, so just a few points to help you improve and to increase your chances of being understood.
waz = was
zat = that
u = you
ur = your (sometimes you're - short for 'you are')
z = the
@ = at
hw = how
Creating the button isn't enough. You need to add it to the form's Controls property.
Button button = new Button();
button.Text = "&Created in Code";
button.Size = new Size(100, 23);
button.Location = new Point(12, 12);
this.Controls.Add(button);
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)
|
|
|
|