|
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?
|
|
|
|
|
The html may be dynamically created based on the browser being used.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Yes ... maybe it is, but is there a way to "simulate" being IE? ... Whatever I try it doesn't work right.
For your understanding: it's about filtering any links out of a website like a spider, source-text in IE shows the links as <href....etc.>, firefox and everything I've tryed in C# shows just javascript-code as result.
Is there a way to extract the links from the returned javascript/html-code?
Thank you for your quick answers
|
|
|
|
|
Yep, there sure is. Set the UserAgent property of your HttpWebRequest object to simulate IE's User Agent. Here's a list[^].
Then, to parse that stuff out, use a regular expression on a tags. If you want to get it out of the JavaScript, the only sure fire way to do that is to evaluate the JS. I have no real help for you on that. Sorry.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Parsing out the links from html isn't the problem. I have tried setting UserAgent property of httpwebrequest to 20 different useragent-strings i have found on the net - everytime the same, wrong result.
The mystical on the thing is this:
When I open a site with IE (for example http://derstandard.at) and click right mouse, source-text I see what I want to see, many links, less javascript. So I tried using fiddler2 to see what header information the http-request has. The mystical is: in fiddler2 i see the same wrong thing as in firefox as html-context for the requested page. Only right click - source-text in IE results the right html i need popped up in notepad.
I don't understand it...
Any suggestions ... anyone?
|
|
|
|
|
I don't know if this is true, but does IE show the "source" of the page that includes DOM manipulations by the JavaScript? If so, maybe you should create a WebBrowser control, point it to the correct URL, and then read the DocumentText[^] property to see if it has what you want.
This definitely won't work on Mono.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi,
In my windows application, one column of the datagridview is checkbox column.
Please let me know how can I enable/disable the checkbox controls.
Thanks in advance..
|
|
|
|