|
Kwagga wrote: Even if I have to say so myself....
Smartass - your code earns you a perma link as I'm certain to need this sometime in the future! Thanks
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
NO worries mate. Glad I could help 1 person today.....
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
The original RFC regex is (as follows):
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]) It's not perfect, but is a starting point.
"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
|
|
|
|
|
In datagridview how will I make a validation for the length of text written in cell, eg. mobile no column takes on 10 digits
|
|
|
|
|
|
I am not want in ASP.NET or web page I want to validate in windows application
|
|
|
|
|
Check this one
http://msdn.microsoft.com/en-us/library/ykdxa0bc.aspx[^]
Thank you
Vuyiswa Maseko
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I have atleast 15 columns but in crystal report the all columns are not legible properly. give me some suggesstions how will I show or print that records. Is there is any option in crystal report of landscape.
thanx in advance
|
|
|
|
|
hEY TRY THIS.
CrystalDecisions.CrystalReports.Engine.ReportDocument r = new CrystalDecisions.CrystalReports.Engine.ReportDocument();<br />
r.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
But how will I set the columns
|
|
|
|
|
Hi,
what you want to do ?
You want to display only 10 columns from 15 ?
Explain properly.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
No there are 15 columns and I want to show all these columns in landscape form but how will I set the all these columns in crystal report.
|
|
|
|
|
Hi,
do you want this ?
Try[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
I have very weird problem with the windows command prompts standard input.
When i write regular dos command like cd or dir to the input stream everything goes as expected BUT when i want to execute a GUI app (say notepad) the window doesnt show up until i write some empty lines to the stream?
cmd.StandardInput.WriteLine("notepad");
cmd.StandardInput.Flush();
cmd.StandardInput.WriteLine("blaaaaa");
cmd.StandardInput.WriteLine("blaaaaa");
cmd.StandardInput.WriteLine("blaaaaa");
Please help..this is so weird, even my friend google couldnt help me
|
|
|
|
|
add
cmd.StandardInput.Close();
after
Druuler wrote: cmd.StandardInput.WriteLine("notepad");
cmd.StandardInput.Flush();
*12Code
|
|
|
|
|
Hi thanks for ur answer...but im using asynchronous beginreadline and need to keep cmd alive?
|
|
|
|
|
You only need to close StandardInput, not cmd.
*12Code
|
|
|
|
|
hmm...But cmd exits when i close the input stream and even if it didnt exit how would i go about write to the input stream again?
Could you give an code example maybe?
|
|
|
|
|
Hi all,
I am trying to convert a byte array in to a character array and trying to write the character array in a text file...
The character set till 127 is propetly written.. whereas all the characters which is above 127 is modified as '?' i.e ascii number 63.....
How can i write this to the text file...
the code snippet..
Byte[] encryptedData = myrsa.Encrypt(newdata, false);
Char[] asciiarray = encoding.GetChars(encryptedData);
FileStream fs = File.Open(FilePath,filemode,FileAccess.Write);
sw = new StreamWriter(fs, Encoding.ASCII );
sw.WriteLine(new string (asciiarray));
sw.Close();
The above code writes only ascii characters whose values are less than 127 whereas all other characters are automatically changed to '?'
Googled, but no fruits......
Have a Happy Coding.....
|
|
|
|
|
Converting from a byte[] to a char[] is odd, because the two values are not the same at all.
The bytes you (correctly I think) have in your encrypted data are unsigned 8 bit quantities. Chars are 16 bit unicode quantities. Since you are then trying to write these to an ASCII encoded (7 or 8 bit depending on who you talk to) there is some oddness here.
Why not just write the byte[] to a normal filestream? Or encrypt it into the filestream directly? There is a cryptostream, after all...
Here is my generic encrypt routine (uses RSATriple)
public void Encrypt(Stream sIn, Stream sOut)
{
string Routine = "Encrypt: ";
if (key == null)
{
throw new Exception(Routine + EX_CRYPTO_NOKEY);
}
if (sIn.Length > int.MaxValue)
{
throw new Exception(Routine + EX_CRYPTO_TOOBIG);
}
sOut.Write(CreateBlockHeader(sIn), 0, encAlg.BlockSize);
CryptoStream encrypt = new CryptoStream(sOut, encAlg.CreateEncryptor(), CryptoStreamMode.Write);
int inputLength = (int)sIn.Length + encAlg.BlockSize;
byte[] abIn = new byte[inputLength];
sIn.Read(abIn, 0, inputLength);
encrypt.Write(abIn, 0, inputLength);
encrypt.FlushFinalBlock();
key.Reset();
if (sIn.CanSeek)
{
sIn.Seek(0, SeekOrigin.Begin);
}
if (sOut.CanSeek)
{
sOut.Seek(0, SeekOrigin.Begin);
}
}
[EDIT]Edited to correct spelling errors caused by dyslexic keyboard[/EDIT]
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 Thank You so much for the valuable input...
But even in a different encoding style(UTF-8, UTF-32 etc) the characters are not written to the file......
Any clues on that>???
Have a Happy Coding.....
|
|
|
|
|
Because the data you start with is not UTF, or ASCII or any other character set based data. It is raw bytes. Unsigned 8 bit values. Why convert these? In your example:
Byte[] encryptedData = myrsa.Encrypt(newdata, false);
Char[] asciiarray = encoding.GetChars(encryptedData);
using (StreamWriter sw = new StreamWriter(filepath, FileMode.Create))
{
sw.Write(encryptedData, 0, encryptedData.Length);
}
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
|
|
|
|
|
You can't use GetChars to decode the encrypted data into text, as it's not text that was encoded in the first place.
If you want to represent the data as text, you can for example use base64 encoding:
string text = Convert.ToBase64String(encryptedData);
If you want to save the data to the file without changing it, you should write it as bytes, not as text:
File.WriteAllBytes(FilePath, encryptedData);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Yes!!! exactly!
I have modified the code in the following way...
Byte[] encryptedData = myrsa.Encrypt(newdata, false);
FileStream fs = File.Open(FilePath,filemode,FileAccess.Write);
sw = new StreamWriter(fs, Encoding.ASCII );
sw.WriteLine(Convert.ToBase64String(encryptedData));
Thank you all for the help!!!
Have a Happy Coding.....
|
|
|
|
|
In the past I had trouble with a PictureBox es MouseUp event, but that fixed itself and never got an issue afterwards.
Now another of its events is causign me headaches.
MouseDown should occur when the cursor is above the control while a mouse button is held down, right?
So, selecting multiple cells in Excel uses the same principle or?
My problem is that I have a lot of PictureBox es directly next to each other and with the MouseDown event I wanted the user to select multiple PictureBox es.
Yet, it gets fired only once for the first time you click and hold a mouse button, it should get fired every time you select another PictureBox , but it only gets fired again after releasing the mouse button and pressing it again.
Of course, that makes selection impossible.
Could anyone tell me what went wrong and how can fix it?
I'm trying to achieve the same effect with the MouseHover event, but that will be a makeshift solution at best.
EDIT:
Scrap that part with the MouseHover event, that doesn't ever fire.
modified on Wednesday, May 6, 2009 5:32 AM
|
|
|
|