Two-dimensional problem of evanescent wave scattering by dielectric or metallic cylinders near the interface between two dielectric media is solved numerically by boundary integral equations method. A special Green function was proposed to avoid the infinite integration. A pattern with a circular and a prolate elliptic cylinders, respectively, is suggested to simulate the sample and the probe in near-field optical microscopy. The energy flux in the midplane of the probe-cylinder is calculated as a function of its position.