Can't get rid of fruit flies

This happened to me once when I kept a pineapple on my counter for too long. The fruit flies were eveywhere. I know this sounds crazy, but I sprayed them with Windex. I figured it was poisonous enough for the flies, yet safe enough to be sprayed on kitchen surfaces. It worked. Good luck!