|
Dear All,
currently i am using Socket class to send and receive files from FTP.
every thing works fine and I am really happy with that. My concern is i can download files at fixed number of bytes as i am fixing my buffer to be send to server at 16*1024 bytes (16KB). I am looking for a method where i can download files from ftp at my internet bandwidth and the same should apply for uploading too.
i am looking to hear from u guys
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
|
Try the OnValueChanged event. Check if all four got a value, and if true, write the contents to the textbox
I are troll
|
|
|
|
|
|
The OnValueChanged should fire for each combobox, but you'll only need one event-handler. Once you written the code for ComboBox1, you can reuse it by hooking up the event from ComboBox2, ComboBox3 and ComboBox4.
I are troll
|
|
|
|
|
Can I add a page form1.aspx as ContentTemplate and pageTitle of the page form1.aspx as HeaderTemplate from c# Programaticaly?
Please help me with code.
shahdat
modified on Sunday, May 24, 2009 5:43 AM
|
|
|
|
|
hello
Having trouble with DESCryptoServiceProvider - specifically, key size of public key from extracted from "mykeys.snk" (using sn.exe, byte[160]) not compatible with DESCryptoServiceProvider which is expecting byte[24].
Here's how I extract public key from snk file:
<br />
FileStream oKeyPairFileStream = File.OpenRead("mykeys.snk");<br />
System.Reflection.StrongNameKeyPair oKeyPairFile = new StrongNameKeyPair(oKeyPairFileStream);<br />
byte[] btPublicKey = oKeyPairFile.PublicKey;<br />
return btPublicKey;<br />
Here's how I do encrypt:
<br />
byte[] btGeneratedKey = null;<br />
tDESalg.GenerateKey();<br />
btGeneratedKey = tDESalg.Key; <br />
tDESalg.Key = btKey;
<br />
tDESalg.Mode = CipherMode.ECB;<br />
tDESalg.Padding = PaddingMode.PKCS7;<br />
<br />
CryptoStream cStream = new CryptoStream(oMemStream,<br />
new TripleDESCryptoServiceProvider().<br />
CreateEncryptor(btKey, tDESalg.IV),<br />
CryptoStreamMode.Write);<br />
This would give error message:
<br />
"Specified key is not a valid size for this algorithm."} System.Exception {System.Security.Cryptography.CryptographicException<br />
I got a feeling you can't use key from snk file to encrypt by way of DESCryptoServiceProvider, am I right?
Thanks
dev
|
|
|
|
|
Hello Experts!!
I m passing parameters customerno. n srno. to crystal report.it must take same record only whose no and srno same wid passed one.But in my report it shown correct record but many times.
e.g.if i pass custno.is 2 and srno. is 3 then it must show corresponding details of match 2&3.Now it shown like this...
Custno Srno name address
2 3 XYZ ABC
2 3 CYZ SED
2 3 XYZ ABC // Extra lines
2 3 CYZ SED
Help Me!!!
|
|
|
|
|
You don't give nearly enough information to get help - but my guess would be that your report links to other tables and so you get one row for each of the records on those tables as your linkage is not correct.
Try looking at the SQL that Crystal generates and running that - it might point you in the right dircection
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
hello
can I generate a test X.509 certificate using "makecert.exe", taking "snk" file from "sn.exe" as input?
Thanks
dev
|
|
|
|
|
I'm having a problem with the ThreeState property. Currently, the checkBox's only have the values of "0" and "1", and I need the ThreeState to equal "2" somehow!
This code creates the checkBox's:
private void makeArea_Click(object sender, EventArgs e)
{
if ((areaXNumber.Value <= 11) && (areaYNumber.Value <= 11))
{
arrX = Convert.ToInt32(areaXNumber.Value);
arrY = Convert.ToInt32(areaYNumber.Value);
panel1.Controls.Clear();
int x, y = 12;
for (int j = 0; j < arrY; j++)
{
x = 12;
for (int i = 0; i < arrX; i++)
{
CheckBox chkb = new CheckBox();
chkb.Location = new Point(x, y);
chkb.Size = new Size(15, 14);
panel1.Controls.Add(chkb);
x += 21;
}
y += 21;
}
}
else
{
MessageBox.Show("Lower your checkbox amount!");
}
}
This code appends it all to a StringBuilder then posts it to a richTextBox:
private void insertArea_Click(object sender, EventArgs e)
{
StringBuilder area = new StringBuilder();
if (panel1.Controls.Count > 0)
{
area.AppendLine();
area.AppendLine("arr" + areaArrayNumber.Value + " = {");
for (int i = 0; i < arrX * arrY; i++)
{
if (i % arrX == 0)
area.Append("{");
area.Append(Convert.ToByte(((CheckBox)panel1.Controls[i]).Checked));
if (i % arrX == arrX - 1)
{
if (i + 1 == arrX * arrY) area.Append("}\n");
else area.Append("},\n");
}
else area.Append(", ");
}
area.AppendLine("}");
}
else
MessageBox.Show("There are no checkboxes!", "Error");
scriptForm.Text += area.ToString();
}
What this code does, is let the user decide how many checkBox's on the X axis, then the Y axis, so let's say numericalUpDown1 and numericalUpDown2 value's are equal to 3. This is what the outcome is currently (1 = Checked/0 = Unchecked):
arr1 = {
{1, 1, 1},
{1, 0, 1},
{1, 1, 1}
}
I want the ThreeState to be able to do this (2 = Third State/1 = Checked/0 = Unchecked):
arr1 = {
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
}
I hope this is enough information to help! If not, please let me know. I appreciate your time reading this!
|
|
|
|
|
Without going through your code I think you'll find that "3 state" refers to null,0,1 and is not flexible.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Well that's a bummer :\, is there any sort of loophole to always have a "2" in the middle of the checkBox array?
|
|
|
|
|
Xenoserv wrote: is there any sort of loophole
Of course there is, see Luc's suggestion, there is almost always a way round it, defining the cost of the work around is another matter
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
as you don't use the Text property of the CheckBoxes, they aren't much more than a white/gray/black square. Why don't you make your own Control?
You could derive from Panel, and:
- give it a background color;
- a Clicked event to cycle through the possible colors;
- a value (either stored in the Tag, or through a Dictionary which maps colors to values, of any type you choose)
Instead of a color, you could paint a digit in there, by hooking up a Paint event handler; if Tag is a 1-digit string, then e.Graphics.DrawString(((Panel)sender).Tag,myFont,0,0); could be pretty close to what you want.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Something like in Minesweeper?
|
|
|
|
|
Yea, like minesweeper haha
|
|
|
|
|
The CheckState enum is like this
Unchecked = 0,
Checked = 1,
Indeterminate = 2 You can use the CheckBox.CheckState property to get the current value.
If you need to retrieve it via an event when it changes you can use the CheckBox.CheckStateChanged event.
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)
|
|
|
|
|
Good people,
Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)? We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path. I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary.
Let me know your thoughts?
Thanks,
Blitz
|
|
|
|
|
IMO you should not do so. It gets messy pretty soon. AFAIK Vista and future Windows will prevent regular users from doing that anyhow.
The app itself belongs somewhere under C:\Program Files\ using some folder hierarchy reflecting company and product name and possibly version.
The data files your app needs could go in one of the special folders provided for such purpose.
See Environment.GetFolderPath, and SpecialFolder.ApplicationData/CommonApplicationData. There too some folder hierarchy should be applied.
And the user-visible files your app deals with (its documents) probably belong somewhere inside "My Documents" which also should be reached through the corresponding SpecialFolder.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks Luc,
Where should the LogFile (of database errors) be placed? We may need them to email it to us for support purposes.
Thanks again,
Blitz
|
|
|
|
|
I guess your DB logfiles are common to all users, hence I would suggest SpecialFolder.CommonApplicationData; that is where I put user-agnostic logfiles.
And I try and provide a command inside my app to explore that folder, or mail it to me, or whatever is appropriate; so the users don't have to explore their disk to get hold of it, and I don't have to explain the details in the documentation (since that folder may actually vary depending on the Windows version and some installation choices).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc, what would you do with the Log file?
Thanks,
Blitz
|
|
|
|
|
I would be angry if a program would do that to me..
In fact, I have been angry for that reason quite often already.
Both Java and nVidia see fit to place their crap in C:\
|
|
|
|
|
Thanks to both of you.
By the way, do you know where I can find documentation recommending against using the root directory. The other programmer is a Java programmer and thinks that writing to the root directory is fine.
Thanks again for your help,
Blitz
|
|
|
|
|