|
It's only in framework 2.0
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Best regards, Alexey.
|
|
|
|
|
how can i show scrollbars on picturebox, i dont want to show an image as streched. I like to show on normal mode. but sometimes image is bigger than picturebox sizes. so i cant see other pice of image .
|
|
|
|
|
Put PictureBox on Panel, set size of PictureBox equal to image size, and set Panel AutoScroll property to true.
Best regards, Alexey.
|
|
|
|
|
I have been researching ClickOnce deployment, and I am very curious to hear from a few folks who have actually used it and deployed with it and had remote users updated with it, and, hopefully, someone who has used some of the advanced technical capacities offered in it such as scripting.
thanks, Bill
"The greater the social and cultural distances between people, the more magical the light that can spring from their contact." Milan Kundera in Testaments Trahis
|
|
|
|
|
how do I convert a C# program into a windows installer? tips and advise would really really be of help.
or maybe there's a software i can use to change my C# program into an installer.
|
|
|
|
|
You should create a setup project for your application. Don't try to make your application install itself. Visual Studio has support for creating setup projects. There are many articles that show how to do it.
Josh
|
|
|
|
|
Hi all,
What is the best way to deal with the next problem:
I Have a ASP login page with codebehind C#
The user is allowed to login more then once on the same computer. But he is not allowed to login more than once on different computers.
should I keep record of it in a database with which ip address a user is logged in or are there other ways?
thanks in advance.
|
|
|
|
|
IP address will not work because the multiple computers could be behind a firewall that does Port Address Translation. The server cannot distinguish machines using IP address.
Even though I know that IP addresses won't work, I don't know what will.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Curious though. Why do you have this strange requirement? Maybe, I can think of some solution if I understand the problem better.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
It's for an intranet application. Everyone in our company has their own computer so normally they would only logon on one machine. Since every user has different roles it could be possible that someone stole a password to do things they're not allowed to. It's like msn messenger, it automaticly logs of on one computer when you login on another one. Except that we would like to make it impossible to login when the user is already logged in on another computer.
I hope this makes it a bit more clear.
|
|
|
|
|
You are making it clear. Since it is an intranet application, the use of IP address may not be a problem. But, the networking guys has to make sure that there are no devices on the network that makes network packets from multiple machines look as though they came from the same IP address.
======
Now, being interested in computer security, and having done some work in that domain (not a whole lot )
But, IMO, as a security measure, the mechanism you are proposing will work only against casual attackers. A more determined attaqcker would use the other employee's machine during lunch break, or after work. There are many other ways to compromise the security, but you may want to consider the following.
Stealing a password should not be that easy. Why do you think that you need to protect against a stolen password? You have to make sure that employees have proper passwords, and that they are changed often --
a. They should be forced to change passwords every month
b. They are not allowed to use the previous N passwords, when changing passwords.
c. A password complexity check has to be implemented.
d. All communications should be done through SSL
e. Do not allow multiple logins at all. Timeout inactive logins after a reasonable time period -- whatever is reasonable for you application.
f. Username/passwords have been proven quite inadequate for many purposes, forcing some firms to use biometric devices like finger print detection or an eye retina scanner.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thanks for your reply and I'll certainly take in mind some of the things you proposed. Although finger print detection or an eye retina scanner if a bit far fetched
Dimitris
|
|
|
|
|
hi
i want to count the number of words I have in string (is anybody has code example )
thanks
eyalso
|
|
|
|
|
Here is the sample:
<br />
string text = "This is my string";<br />
string[] words = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);<br />
int countWords = words.Length;<br />
Best regards, Alexey.
|
|
|
|
|
I have a problem with " StringSplitOptions" (cant find it)
i need to import a class or dll ?
eyalso
|
|
|
|
|
This enumeration added in framework 2.0.
If you're using framework 1.1 use this code:
<br />
string text = "This is my string";<br />
string[] words = text.Split(new char[1] { ' ' });<br />
int countWords = words.Length;<br />
Best regards, Alexey.
|
|
|
|
|
For example,you have picture(is painted with solid colors not gradiant) at mspaint,
I would like to change all X color to Y color.
How could i achive that?
Is there any method at Drawing class (i coulnd find any :'()
|
|
|
|
|
hi,
i think there is no direct method to accompolish this with C#.you have to use API like bitblt and compare the colors and change..
you can try with GDI/Graphic section...There is a lot of samples i found last time.
good luck
Where there is a will,there is a way.
|
|
|
|
|
Hi,
a simple way would be to load it as a Bitmap and to iterate over every pixel and use the GetPixel/setPixel functions on the bitmap to change pixel by pixel. As those calls are rather slow you could also go the unmanaged way. Have a look at Image Processing for Dummies by Christian Graus[^] for further details on this.
|
|
|
|
|
thank you
I found this sample so GetPixel and SetPixel is ok for me.
My new question is
my picture box is set to Strech view.
My image's width =768 , height=503
but on secreen, rightbottom corner pixel coordinat is x:460 y:261
So when i want to show color where mouse on over, it shows another color because of wrong coordinats. might i convert to coordinats?
Bitmap bitmap = new Bitmap("C:\\TV2.bmp");<br />
int width = bitmap.Width;<br />
int height = bitmap.Height;<br />
<br />
int i, j;<br />
for (i = 0; i< width; i++) <br />
{<br />
for (j=0; j<height; j++)<br />
{<br />
Color pixelColor = bitmap.GetPixel(i, j);<br />
int r = pixelColor.R;
int b = pixelColor.B;
Color newColor = Color.FromArgb(r, 0, b);<br />
bitmap.SetPixel(i, j, newColor);<br />
}<br />
}<br />
this.BackgroundImage = bitmap;
-- modified at 6:03 Friday 5th May, 2006
|
|
|
|
|
Hi,
might be difficult because the PictureBox won't reveal this. You could try to calculate it yourself (not tested):
float sw = 1f * pictureBox.Width / bitmap.Width;
float sh = 1f * pictureBox.Height / bitmap.Height;
int xPic = xMouse * sw;
int yPic = yMouse * sh;
where x/yMouse are the mouse coordinates you are getting and x/yPic should be the coordinates within the picture. But I don't know if this is accurate enough (might be that you'll also have to consider the border of the PictureBox).
|
|
|
|
|
You can also replace colors using the ImageAttributes and ColorMap classes.
Example replaces red->yellow, blue->magenta.
<br />
Graphics g = Graphics.FromImage(im);<br />
ImageAttributes attr = new ImageAttributes();<br />
<br />
ColorMap[] remap = new ColorMap[2];<br />
<br />
remap[0] = new ColorMap();<br />
remap[0].OldColor = Color.Red;<br />
remap[0].NewColor = Color.Yellow;<br />
<br />
remap[1] = new ColorMap();<br />
remap[1].OldColor = Color.Blue;<br />
remap[1].NewColor = Color.Magenta;<br />
<br />
attr.SetRemapTable(remap);<br />
g.DrawImage(im, new Rectangle(0, 0, im.Width, im.Height), 0, 0, im.Width, im.Height, GraphicsUnit.Pixel, attr);<br />
|
|
|
|
|
I want one program logic for finding the total number of occurance of specific string in files which are in specified directory.
Program will return the total number of occurances file wise.
|
|
|
|
|
|
hello frns..
pls help me on encription/decription.. i want to encrypt/decrypt a message.i am using asp.net 2005
|
|
|
|