|
Thanks Griff, just what I need. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
nice example.
thanks
|
|
|
|
|
You shouldn't use MD5 for new applications - it is officially "broken". Use SHA-512 instead, as it is currently ok until the SHA-1024 spec is released in 2012. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Hi please check this link
http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx
thanks
|
|
|
|
|
Rather than storing the password, store a hash of it. Encrypt and "salt" the password before modifying it to get the hash. Store this hash. Then, when the user enters their password, create the hash from it and compare it to the hash you have stored in the database.
Doing it this way will prevent somebody who gains access to your database from learning any of the passwords, but still gives you the ability to use passwords to secure data and transactions.
|
|
|
|
|
Encrypt it before storing it into the database.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
|
Hello,
I am trying to make a Remote Desktop Connection software, that does not use the default Windows Remote Desktop, mainly because I want it to work by entering IP's and not domains/names/username etc..
My idea is that the client will capture the screen once and send the image to the server. After that, it will simply take a new screen capture, compare it to the previous one and only send the modified data to the server. The server will know to take the modified that and create the new image from the one he has.
How can this be done? Can anybody show me a sample?
I hope I explained clearly and somebody can help. It's something like a "patch" for a file ...
Language used : C# - Vs 2008
Thanks in advance
|
|
|
|
|
Scrap what you have and Google for "VNCSharp". It's a library that does exactly what you're talking about and will do a far better job and send updates much faster than you can code your version to do the same job.
|
|
|
|
|
Hello,
I already know about VNCSharp, but my problem is that I don't know how to write the server for it.
That's only the client
Any suggestions? If somebody can tell me how to "patch" the files or how can I start to write the VNC server ?
Hope someone can help.
Thanks
|
|
|
|
|
|
I placed a webviewer in my winapp that calls up the isbndatabase and conducts a search. For some reason I constantly get a script error for .js is there anyway to disable javascript so this error will go away or do I need to enable something ?
thanks
|
|
|
|
|
By "webviewer" do you mean "WebBrowser"? If so, there is a property on the WebBrowser to suppress JavaScript errors.
|
|
|
|
|
yes I meant browser sorry. Okay i found the property thanks
|
|
|
|
|
Hello,
I am writing a client app for Windows Mobile 6.5. This app will need to communicate using ssl to a server app. For the ssl I am using ManagedOpenSsl.dll that came with OpenSSL.NET. I have not figured how to use this dll to make an ssl connection. Does anyone have a link to a tutorial that can help me with this?
Thanks in advance
Kiotayamodified on Tuesday, March 2, 2010 7:20 PM
|
|
|
|
|
Check this: http://www.thetazzone.com/tutorial-how-tosign-a-certificate-request-with-openssl/
modified 27-May-14 4:55am.
|
|
|
|
|
This was not what I was looking for
but thank you for the response.
|
|
|
|
|
I found out that this dll does not work with Windows Mobile SDK. The dll refrences System.Net.Authentication which is not part of WCF.
Does anyone know of a way to use SSL with Windows Mobile that is not using Http?
|
|
|
|
|
Hi,
I am having an issue regarding the thumbnail quality and image size. I am using ImageList and ListView to display the images. The problem occurs when i try to create the image from the filepath or from a memorystream object. The quality appears to be blurry.
I did set the quality to "Depth.32Bit". But this still hasnt solve the problem.
I also want to maintain the aspect ratio of the ImageSize dynamically if possible?
Can anyone help kindly me please regarding the above requests/issues?
Here is the code i created behind a datagridview click event.
this.StaffListView.View = View.LargeIcon;
this.StaffListView.LargeImageList = StaffImageList;
StaffImageList.ImageSize = new Size(120, 120);
StaffImageList.ColorDepth = ColorDepth.Depth32Bit;
int pos = StaffDataGridView.CurrentRow.Index;
try
{
if (File.Exists(StaffDataGridView.Rows[pos].Cells[1].Value.ToString()))
{
byte[] ImageD = (byte[])StaffDataGridView.Rows[pos].Cells[2].Value;
String RfilePath = StaffsDataGridView.Rows[pos].Cells[1].Value.ToString();
MemoryStream memStream = new MemoryStream(ImageD);
Image image = Image.FromStream(memStream, true);
string filename = fileNameExtractor(RfilePath);
StaffImageList.Images.Add(RfilePath, image);
StaffListView.Items.Add(filename, RfilePath);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message.ToString());
}
I also tried not to use the thumbnail thats in the database by creating a thumbnail image from scratch by using an overidden thumbnail method to create a thumbnail and then add that thumbnail to the ListView. This was to check if the problem is with the image in the database but thats where i am having difficulty identifying the where the issue is actually occuring.
I would appreciate if you could get back to me please?
Thanks,
|
|
|
|
|
Hi,
from what I read in the documentation, not from experience, I would say you can't get what you want in that way. There may actually be multiple problems:
1.
ImageSize sets the size of all images in the list (defaults to 16*16). If the images you add have a different size, they will be rescaled. If you set a size of 160*160 while the images have smaller size originally, they will be scaled up resulting in poor quality. What is the typical size of the images in the database?
2.
The rescaling is also likely to alter the aspect ratio. You could preserve aspect ratio by creating a new, square, image yourself. One way to do that is like this:
- create an empty Bitmap of the right size;
- call CreateGraphics on it;
- fill it with the background color you want using Graphics.FillRectangle()
- then use an appropriate Graphics.DrawImage() overload to paint the image, homogenously rescaled, and centered, leaving the borders (top and bottom, or right and left, depending on how the aspect ratio fits) in the background color.
You now have a square image of correct size fitting your ListView requirements.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Hi,
A typical image may vary because i am using different size images. Typical size may be 1024 x 768 or 640 x 480.
if you dont mind could you give me some sample code regarding #2 please?
Thanks,
|
|
|
|
|
Untested (see also my next message):
public Bitmap ResizeImageKeepingAspectRatio(Bitmap bm1, int w2, int h2, Brush backColor) {
int w1=bm1.Width;
int h1=bm1.Height;
Bitmap bm2=new Bitmap(w2, h2);
Graphics g=Graphics.FromImage(bm2);
g.FillRectangle(backColor, 0, 0, w2, h2);
int x2=0;
int y2=0;
float scale=1;
if (w1*h2>w2*h1) {
y2=h2-h1*w2/w1);
scale=w2/(float)w1;
} else {
x2=w2-w1*h2/h1);
scale=h2/(float)h1;
}
g.ScaleTransform(scale, scale);
g.TranslateTransform(x2/2, y2/2);
g.DrawImage(bm1, 0, 0);
g.Dispose();
return bm2;
}
You need to test this; I suggest you give it a 100*100 and convert it to first a 40*50, and then a 50*40.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
modified on Friday, February 26, 2010 6:54 PM
|
|
|
|
|
Hi Luc,
Thanks for your help. I do have a small problem regarding images which have 640(width)and 480(height). The right hand side of the image appears to be cut off so i cant see whats on the right hand side of the image. I did pass in the paramters as suggested.
I tried using the Width and Height property of ImageList size(100,100) and passed it into your method to test the if it would work. Now images which are 1024 by 768 scale nicely. I then increased the size of the ImageList to (150,150) but that hasnt solved the issue.
if i set the ImageListSize to (40,50) or vice versa than the images look small.
if i pass in just the values 40, 50 or 50, 40 into your method the images look small and the corner of the images are cut off(the 640 by 480 image).
I tried to adjust your code so i could fix the problem but i havent yet been able to solve it.
Can you advise please?
Thanks,
|
|
|
|
|
forget the 40,50 and 50,40; that was for testing my code only, which I did, see my other post.
No need to adjust my code any further, it does what its name implies.
If you can't get your stuff right, explain in detail and provide code and symptoms.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Hi,
I am testing the following code. Its just the images which are 640 x 480 appear to be cut off on the right hand side. What i mean is say you have a picture(640 x 480) of a Table but on the right side of the table there is something there, say a bowl of fruit, if i use the method below it cuts it off so you dont see the remaining contents of the image.
I did set the boolean parameter to true but i am not sure why the problem is occuring with those image sizes? I assumed that it would keep the aspect ratio.
public Bitmap ResizeImageKeepingAspectRatio(Image bm1, int w2, int h2, Brush backColor, bool centered)
{
int w1=bm1.Width;
int h1=bm1.Height;
Bitmap bm2=new Bitmap(w2, h2);
Graphics g=Graphics.FromImage(bm2);
g.FillRectangle(backColor, 0, 0, w2, h2);
int x2=0;
int y2=0;
float scale=1;
if (w1*h2 > w2*h1) {
if (centered) y2=h2*w1/w2-h1;
scale=w2/(float)w1;
} else {
if (centered) x2=w2*h1/h2-w1;
scale=h2/(float)h1;
}
g.ScaleTransform(scale, scale);
g.TranslateTransform(x2/2, y2/2);
g.DrawImage(bm1, 0, 0);
g.Dispose();
return bm2;
}
Here is the code i am using in the button click
StaffImageList.ImageSize = new Size(120, 120);
this.StaffListView.View = View.LargeIcon;
StaffImageList.Images.Add(fPath, ResizeImageKeepingAspectRatio(img,StaffImageList.ImageSize.Width,StaffImageList.ImageSize.Height, brush, true));
Could you advise please?
Thanks
|
|
|
|
|