In this work we propose a method for on-chip detection of the complex refractive index of the sensing medium at multiple wavelengths for selective sensing. For the optical sensor to be selective, i.e. able to determine the substance present in the medium, either surface functionalization or absorption spectroscopy is often used. Surface functionalization is a complex process and is mainly limited to biological media. On the other hand, absorption spectroscopy is not suitable for on-chip sensing with micrometer dimensions as this will result in poor sensitivity, especially when working far from the substance absorption peaks. Here, we detect the dispersion of both the real n and imaginary k parts of the refractive index which are unique for each substance. This is done using a single micro-ring resonator (MRR) that exhibits multiple resonances over the operating wavelength range. The real and imaginary parts of the medium refractive index are determined at each resonance using the resonance wavelength and the absorption coefficient, respectively. In addition, using this technique the concentration composition of a multi-element medium can be determined by solving a system of linear equations that corresponds to the different wavelengths (resonances). We designed a silicon-on-insulator (SOI) ring-resonator operating in the near-infrared region from λ = 1.46 µm to λ = 1.6 µm. The ring exhibits 11 resonances over the 140 nm operating wavelength range where the corresponding medium refractive index is obtained. This design can detect four different substances namely, methanol, ethanol, propanol, and water. An average error of less than 0.0047% and 1.65% in the detection of the real and imaginary parts, respectively were obtained. Finally, the concentration composition of different multi-element media were successfully determined using the least square method with 97.4% detection accuracy.