|
I want to write codes of an adjusted affine transformation which works interactly. And my question is,
The user, browses and opens a picture file. I would like to get the pixel coordinates (x,y) of a point which is clicked by mouse. So, an event should be done. i am planning to write this in C# but if u have any ideas in other programming languages, please, don't hesitate to write. : )
Thank you.
|
|
|
|
|
I'm guessing you're putting the picture in the picture box, so you can add a PictureBox1.MouseClick event and in the event you can get the coordinated like this: e.X (for the X coordinate) and e.Y , or alternately: e.Location.X ,e.Location.Y
|
|
|
|
|
You can use javascript.
on_click event, use following code
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
Nana
|
|
|
|
|
Thank you for your responds. pictureBox tool has an event like this but i couldn't see.
|
|
|
|
|
I have a textbox and two radio buttons. If the value in the textbox is negative, radiobtn2 should be selected otherwise if it is positive radiobtn1 should be selected.
First, the code:
this.textbox1.Leave += new System.EventHandler(this.textbox1_Leave);
private void textbox1_Leave(object sender, System.EventArgs e)
{
string firstchar = textbox1.Text.Trim().Substring(0, 1);
//MessageBox.Show("function called");
if(firstchar == "-")
radiobtn2.Select();
else
radiobtn1.Select();
}
The strange behavior is:
1) that his works if I Tab out of the textbox but not if I click out of the textbox.
2) I put a simple messagebox.show in the textbox1_Leave function to see if it was being called, and the messagebox appears when I click out of the textbox and the code then works with a radiobtn being selected! This tells me the function is being called, but when I remove messagebox.show the function again no longer works!
I also tried changing the EventHandler from Leave to LostFocus and the same behavior exists.
Any ideas why this is or what I can do to work around it without having the user's progress be interrupted?
Thanks,
RABB17
"Nothing fancy needed, please just solve all our problems as quickly as possible."
|
|
|
|
|
use radiobtn1.Checked = true; instead of Select
|
|
|
|
|
Thanks Sharpie that worked perfectly! Another example of being too close to the problem
Thanks again,
RABB17
"Nothing fancy needed, please just solve all our problems as quickly as possible."
|
|
|
|
|
hi,
does anyone know how i can copy a complete dir, including subdirs and files to another drive, using c# ?
or do i have to copy each dir separate ?
thx
Kurt
|
|
|
|
|
Try this link. http://www.aspemporium.com/howto.aspx?hid=20[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Use LocalFileSystem objLm = new LocalFileSystem();
objLm.UploadDirectory(source, destination, pattern);
Nana
|
|
|
|
|
Hi,
I have a C# Desktop solution in which there are many projects. When i press Alt+TAB to switch between other opened application, there is no icon displayed against my running application. Please guide me how can i set it for my application.
Regards,
Wasif Ehsan.
|
|
|
|
|
I believe alt-tab uses the icon of the executable. If your program is not showing at all then you might want to make sure your application is shown in the taskbar.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
No sir. Its showing in the taskbar. Even it is showing the icon associated with its exe but the Icon on Alt+Tab is not showing.
|
|
|
|
|
I have 2 resource files for languages in my project and when i compile the project it creates two folders in the folder with the exe, a folder for each language DLL.
now, how can i tell the compiler to put them both in a "Languages" directory?
|
|
|
|
|
sharpiesharpie wrote: how can i tell the compiler to put them both in a "Languages" directory?
I don't think you can. IIRC, .NET had a defined order in which to search for satellite assemblies in order for it to determine which languages the resources are available in.
|
|
|
|
|
but can't i just change like...the link?
tell the compiler to compile those DLLs into a different folder?
and maybe i didn't explain myself clearly, those are not VS dlls, those are resources i created.
|
|
|
|
|
What you've described, as far as I can tell, are satellite DLLs - they contain just the culture specific resource information. They go in subfolderes named after the langauge descriptor, e.g. en-gb, en-us, nl-nl, nl-be, es-es, es-mx, fr-fr, fr-be, fr-ca, etc.
If this is not what you are seeing then maybe you could post a summary of the pertinent files with a path.
|
|
|
|
|
it is..so there's no way to change the folder they're stored at?
|
|
|
|
|
sharpiesharpie wrote: so there's no way to change the folder they're stored at?
Not that I'm aware of. However, it has been a while since I did any localisation stuff and that was with .NET 1.1. From my recollection the satellite DLLs need to go in a specific location relative to the assembly they contain the resources for in order for the resources to be picked up. If the files are not there then .NET will revert to the next nearest version that it can find. e.g. The computer's culture is set as de-at (German as spoken in Austria) but there are no DE-AT satellite assemblies. It will revert to DE (generic German) if available. If not, then it will revert to the neutral culture which is the default your application was built with.
|
|
|
|
|
Ok then, thank you for your help.
Btw, is there any place in the site where i can get reviews and improvement ideas for my program? (Unfortunately I'm 16 years old...so I don't have any friends \ colleagues that know anything about programming)
|
|
|
|
|
Hi,
I'm having a complete nightmare trying developing a client and web services that uses a client certificates.
I've now got to the stage where I can browse the web service using the internet explorer with, this picks up the certificate and all seems to work well, however I can not reference the web service using visual studio 2003.
I'm have to use test certificates using makecert.exe, and to be honest i'm not sure if i'm doing this correctly.
Sorry for the length of this post but i'm trying to provide as much detail as possible. Ideally I would like to just have a batch file for the client and server that installs the required certificates as they way i'm currently doing it is very prone to error.
These are the steps I’ve been using which are very long and quite contrived.
The goal of this attempt is to
--- client computer = coClientComputer
--- server computer = coServerComputer
Step 1 - Generate a root certificate
Assume that a root certificate is required, the root certificate. This is to be placed in to “Trusted Certification Authorities\Certificates”
A trusted root certificate acts as an authority that can be used to sign other certificates, in this case both the server and client certificates.
makecert -r -pe -cy authority -n "CN=Test Root Authority" -sk "Test Root Authority" -sr CurrentUser -ss My -a Sha1 -sky signature TestRootAuthority.cer
Note that this will generate the certificate in the “current user\personal\certificates”, I use mmc to copy it to Local computer\Trusted Root Certification Authorities\Certificates.
Note that I have also used mmc to copy this certificate to the client machine also in the ‘Local computer\Trusted Root Certification’.
Step 2 – Generate a server certificate
makecert -b 01/01/2000 -e 01/01/2036 -pe -cy end -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -sy 12 -sp "Microsoft RSA SChannel Cryptographic Provider" -n "CN=coServerComputer" -sr localMachine -ss My -in "Test Root Authority" -is My -ir CurrentUser TestServer.cer
Step 3 - Attach Server SSL certificate to IIS
Opened IIS,
Select Directory security,
Server Certificate,
Assign existing certificate
Select ‘coServerComputer’ certificate, shown as intended purpose ‘server authentication’
Apply changes.
Step 4 - Generate a client certificate
makecert -b 01/01/2007 -e 01/01/2010 -pe -cy end -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.2 -sy 12 -sp "Microsoft RSA SChannel Cryptographic Provider" -n "CN=coClientComputer" -sr CurrentUser -ss My -in "Test Root Authority" -is My -ir CurrentUser TestClient.cer
this is created in local computer \ personal \ certificates on
the machine where the command is executed, not on the client computer.
Use mmc to transfer this to client. Note I have copied this to
Current user \ personal \ certificates
and
Local computer \ personal \ certificates
Step 5 - Ensure can access web servers from client before enable SSL
Open Visual Studio on client computer and test with client application.
(Ensure that the URL of the web service is pointing to the correct server).
Ok.
Step 6 - Enable server certificate on server with 128 bit encryption
Open IIS on server
Select ‘cdfum_dbservice’ directory
Select properties and directory security
Select ‘edit’ of secure communications
Tick ‘require secure channel SSL’
Tick ‘require 128 bit encryption’
Click ok.
Step 7 - Connect to web server while SSL is enabled
First browse to
http://coServerComputer/CDFUM_DBService/DBService.asmx
Should get message ‘the page must be viewed over a secure channel’
Retry with https.
https://coServerComputer/CDFUM_DBService/DBService.asmx
This works ok…
Now set the new location of the web service in the client to point to the ‘https’ address.
This worked ok…
Step 8 - Install client certificate on client
The client certificate is already on the client machine; however it needs to be in file form for use with .NET.
User MMC
Select ‘current user\Personal\Certificates’
Select ‘coClientComputer’ certificate,
Right click, select ‘all tasks\ export’
Select ‘base 64 encoded x.509 (.cer)’ certificate.
Save to save directory as the test application
‘c:\CDFUM_WEBSERVICE_TESTER\TestClient.cer’
Step 9 - Amend iis to require certificate
Open IIS on server
Select ‘cdfum_dbservice’ directory
Select properties and directory security
Select ‘edit’ of secure communications
Tick ‘require client certificates’
Ok…
Step 10 - Test Web service from Client Browser
https://coServerComputer/CDFUM_DBService/DBService.asmx
ok
------------------------------------------
Step 10 - Test Web service from Client Browser
Ok – if have > 1 certificate in current user / personal the browser asks which certificate to use.
Step 11 - Test Web service from client application
Update web ref….
Just keep getting ‘access forbidden’
|
|
|
|
|
Hi,
I have a simple design where a IPC Client channel sits inside an asp.net
application. It all works great when I run it under VS 2005
however when I deploy the application using Publish and run it there,
i get the following error:
Failed To Connect to an IPC Port: Access is denied.
Any idea what could have caused this?
|
|
|
|
|
Two possibilities pop into mind: is your app published as a non-full trust application? Do you have some software that (such as ZoneAlarm or Norton Internet Security) that blocks/interferes with interprocess communication?
|
|
|
|
|
Thanks !
Its working fine when i remove the Anonymous access and set only the Integrated Windows authentication in the IIS configurations.
Sagayanathan John
|
|
|
|