|
Actually, you don't - you can do this with a regular expression and a little bit of mojo.
"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
|
|
|
|
|
I can't think of any way to do it with a regex that does not split the string and does not limit the words to a constant length - so please tell me, how?
It's probably easier to just split the string though
|
|
|
|
|
yes thats right im only trying to reverse the letters not the words themselves
|
|
|
|
|
Hi,
that is too easy an assignment. Why don't you write code to flip the characters, so
"hello world" becomes "plɹoʍ ollǝɥ"
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hahaha maybe nxt time
modified on Wednesday, March 11, 2009 7:38 AM
|
|
|
|
|
OK, thanks to everyone who gave me ideas and got my brain jogging
I have figured it out and I will post the code here so that if anyone else needs help they can refer to this
Console.Write("> Please enter an input\n> ");
string userInput = Console.ReadLine();
string[] words = userInput.Split(' ');
foreach (string word in words)
{
for (int i = word.Length - 1; i >= 0; i--)
{
Console.Write(word.Substring(i, 1));
}
Console.Write(" ");
}
Console.ReadLine();
P.S. Yes I kno this is a simple task for many of you, so thanks for not flaming me too heavily
|
|
|
|
|
Hi,
I'm trying to encrypt some files using DES algorithm and calculating length as like below.
CryptoStream cryptoStream = new CryptoStream(existingStream, cryptoTransform, CryptoStreamMode.Read);
this.dataStream = cryptoStream;
this.BytesTotal = Convert.ToInt64(Math.Ceiling(Convert.ToDouble(this.BytesTotal) / 8.0) * 8.0);
this.BytesTotal = this.BytesTotal > 0L ? this.BytesTotal : 8L;
It works well for all text files, XML, HTML etc., but when it comes to MS-Word or Excel file it doesnt calcualte size properlly hence i couldnt write into by webrequest. Please let me know what changes are required to make this work right?
Thanks in advance.
|
|
|
|
|
we got the solution
// The encryption algorithm can pad the data by a few bytes, so these lines correct the byte count
int blockBytes = cryptoServiceProvider.BlockSize / 8;
this.BytesTotal = this.BytesTotal + blockBytes - (this.BytesTotal % blockBytes);
Now its working fine
|
|
|
|
|
Hi All,
I was using "FTPWebRequest" API to upload file to ftp server. Now the requirement has changed the host server can be ftp, http or anything. which API should i use for my client app (to upload file). Please help me. Thanks.
|
|
|
|
|
|
if FtpWebRequest works for FTP, then maybe HttpWebRequest might have something to do with HTTP?
you might try it
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi
can somebody help me out from this issue...i have a dropdownlistbox which contains 1 to 15 nos, based upon the selected number i.e if i choose 2 that many dropdownlistbox will dynamically generated with some numbers populated in it. upto this point there is no problem.
my problem is if the user selects any number from the dynamically generated drop down then the selected index changed event should fire for each individually generated dropdownlist box.how to achieve this?
since the dropdownlist box is generated dynamically i dont knw how to write the selected indexchanged event for each dynamic control..
with this i have attached part of the codesnippet..please some body help
label2.Text = "No.of Modules:";
label2.Font.Bold = true;
tc1.Controls.Add(label2);
tr1.Cells.Add(tc1);
DropDownList ddLModule = new DropDownList();
ddLModule.ID = "DropDownListID" + (i + 1).ToString();
ddLModule.SelectedIndexChanged += new EventHandler(DDL_SelectedIndexChanged);
int nTotalRecords = 15;
ddLModule.AutoPostBack = true;
for (int i1 = 0; i1 <= nTotalRecords; i1++)
{
ddLModule.Items.Add(i1.ToString());
}
tc.Controls.Add(ddLModule);
tr1.Cells.Add(tc);
// for all the dynamically genarted drodpwn this event only fires ,i need to fire selcted indexchanged event for each control created dynamically??//
private void DDL_SelectedIndexChanged(object sender, System.EventArgs e)
{
for (int i = 0; i < this.myDDLS.Count; i++)
{
string ddlId = (string)this.myDDLS[i];
Control c = phdIterationDetails.FindControl(ddlId);
if (c != null)
{
DropDownList myddl = (DropDownList)c;
int ModuleRows = Convert.ToInt32(myddl.SelectedValue.ToString());
Session["modulerows"] = ModuleRows;
if (ModuleRows > 0)
{
CreateDynamicModules(ModuleRows);
}
}
}
}
|
|
|
|
|
If you know how to get it done statically (i.e. through Visual Designer), then you can easily find out how to do it dynamically, since all Designer does is generate some code, typically hidden in a file called xxx.Designer.cs
Open it, study it, read the documentation on things you might not be familiar with, and then create your own code.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hi, how can i use WMI to trace process activities; what are the files,registry files it opens or updates in chronological order
|
|
|
|
|
Hello.
I'm fairly new to WPF, coming from AS3. I have a series of canvas objects which I want to 'scatter'. I thought maybe I could do this by having the items in an array, then using a for loop to run the random number and double animation code on each one.
However I'm struggling to place the canvases into an array, can you in fact do this or would I need to think differently?
Regards.
E.
|
|
|
|
|
Hi,
In ajax calender control, when the calender pop up it is overlapped with other controls. It display under other controls. Same happen for ajax validation also. The prompt message show behind the controls, mainly it happen with dropdownlist,listboa and multiline text box.
Is it CSS problem. How to solve it?
Regards,
YPKI
|
|
|
|
|
I have a problem, a PictureBox es MouseUp event gets fired the moment you hold the mouse down, not release it, as it it should be.
I want to let the user select multiple PicturBox es while he holds a mouse button down and stop selecting when the mouse button is released, however, if the MouseUp event gets fired the moment you press amouse button, but not relase it, that is not possible.
Does anyone know some kind of fix or work around?
How do I make the event fire at the right time or how do I let the user select multiple PicturBox es with the MouseUp event?
Thanks in advance.
|
|
|
|
|
Megidolaon wrote: I have a problem, a PictureBoxes MouseUp event gets fired the moment you hold the mouse down, not release it, as it it should be.
I dont think it does...You should change your mouse xD
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I had this probem on several PCs.
The MouseDown fires first, but the MouseUp firest fires immediately after.
|
|
|
|
|
I never had this problem...it might possible that you using oldest version of .Net Framework
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
No, I checked and it's 3.5.
|
|
|
|
|
it may not happen..i thk your event firing may mixed up...did the mouse down event fired?
|
|
|
|
|
The MouseDown fires first, but the MouseUp firest fires immediately after.
|
|
|
|
|
Hi,
First of all - please excuse my poor english.
I am trying to download html content from an url. Just the source-text of the site. When I open a website (for example www.google.com) in IE an look at the source-text (right mouse - view source text) the displayed text is different as if I do the same with Firefox.
I tryed using httpwebrequest, setting useragent, header-information etc. but never get the html content as displayed in IE-sourcetext. What am I doing wrong? Any hint would help.
I have been searching the forums the last 2 days for a solution of this problem but didn't find an answer. Perhaps my understanding of the process is wrong so please give me a hint for what i have to look for.
Best regards,
LC
|
|
|
|
|
Well IE is broken
But what are the differences?
|
|
|
|