With tears in my eyes and sincere appreciation for G-d's kindness, I relate in the following what worked for me. My addication was bad. It even caused me some legal problems. With the advice of my Rav, among other things, I placed filters on all my computers. (Blue K9 is free and worked for me.) I kept the passwords for the office computers at home and the passwords for the home computers in the office. I do not look at women: young or old, pretty or ugly, modestly dressed or otherwise, in person or in pictures, videos, or webpages, except my wife, mother, sister, and daughter. I penalized myself with 3 consecutive days of fasting, morning till night, (no fasting on Shabbat or Yom Tov) for every time I violated the Rambam's prohibition of enjoying to look at even the pinky of a woman. I fasted for 6 consecutive days for every masturbation. Baruch Hashem, I am free from this stuff for approximately the last 2 years after several years of falling prey to my mercy-less yetzer hara.
Fasting was over long time ago. The secret is that the penalty of fasting is very costly on the yetzer hara. It weakens it so much that it is manageable. Even though I still have the threat of fasting hanging over the yetzer hara, I did not need to fast for approximately the last 2 years. After a while, the addiction is gradually out of one's system; and one can relax a little bit. I still do not look at other women and I am very happy about it. Why desire something you cannot have? There is always one where you are, or in the TV or a magazine, etc. that looks attracting to you. So I decided not to look at any women in general.
The addiction was bad enough to disrupt my daily routine. Even though I am embarrassed to relate the extent of my addiction, I would say this that acting out one time gave me enough shame, embarrassment, and self degradation to last for a week. Practically a few days were destroyed. I work and have children and learn Torah routinely. I felt the effect of acting out was quite destructive on things I held dear.
Fasting all day is very difficult. That is why it is a penalty. The threat of fasting 3 or 6 days in a row is what dissuaded me from acting out. After one or two episodes, you would ask yourself, right before you click on the key to bring up the page, if it is worth fasting 6 consecutive days. One need not fast if he controls himself. But if he acts out, he needs to weaken his yetzer.
It came to a point that I viewed this as a WAR that I needed to win. I have Torah. I have a neshama. I want tahara; I want Shechina to be near me; I want to have Olam Haba. That is how I looked at it. Then the measures were not so drastic. I would do it again. BeEzrat Hashem I wouldn't have to.
I wish you all a lot of success in you endeavor to stay away from this dark trap. It is possible to do it. Believe me it is worth the effort.
P.S. If you decide to do the fasting, please consult a rabbi skilled in these matters before doing so. Some may view this method to be rather extreme-but effective- which needs to be supervised by a knowledgeable Rav.