pili and fimbriae are different structures of bacteria but in some books these terms become confused. actually both are different. lengh of fimbriae is more then pili and they are hair like, their proteins are also different then pili. pili consist of protein PILIN.

Pillae are hair-like structures occuring nega-bacteriae. They play vital role in conjugation (hope English-correct). They comprise subunits called pillin that forms a canal that provides exchange of DNA (plasmids for example) between tho bacterial cells.

Fimbriae are hair-like structures present on the surface of some nega-bacteriae, however they may occur in some fungi (Candida albicans, Saccharomyces cerevise) and posi-bacteriae. They are 2-10 nm in diameter and 100-5000 nm lenght. They facilitate adhession to the surfaces and/or host organisms.

It's worth mentioning that in the past pilae were consider as sex-fimbriae. New research have changed that interpretation, though.

If my memory serves me right, the pili, specifically the F-pilus facilitates conjugation. Initially, it was thought that the pili was where the DNA passes through but it was shown that the site od DNA transfer was through another opening in the membranes; pili just serve to facilitate contact between compatible bacteria.