The pain in the corner of your eyes is likely caused by eye infection. But there are many types of eye infections that i can hard to tell what infection of your eyes is. So, you'd better go doctor to see what really happen to your eyes. Now that you feel hurt when you touch it, you shall not touch it and don't scratch it. Or you may get help from some pills or eye drops prescribed by an eye doctor.
It sounds you get eye infection since you get hurt in the corner of your eye. However, eye infection can be caused by several factors. You should go to see a doctor to have them checked to find out the exact reason. It is possible for you get a stye which is an acute infection. In this case, you can apply hot compress if it is not serious. If it is a severe case, you should visit the doctor to get antibiotics to treat it.