Adsorption of nitrogen, hydrogen and methane in square and rectangular nanopores of various sizes has been studied by grand canonical Monte Carlo simulations (GCMC). By comparison of three kinds of potential models, it was found that the site-site model was more rational, which was therefore used in the work. Adsorption behavior of fluids in square, rectangular and cylindrical pores at T=77 K was compared. Prewetting was found in the corners of the square and rectangular pores, which is absent in the cylindrical pores. Adsorption of hydrogen and methane in the three kinds of pores was compared. Among them, the adsorption uptake of hydrogen in the square pore is highest, especially at low pressures, because the effect of potential superposition in the "corners" makes an important contribution to hydrogen adsorption. The results indicate that the presence of corners has a profound effect upon the adsorption and phase behavior of fluids at low pressures.