The openness and anonymity of P2P file-sharing networks have been widely accepted over the last few years. Enormous file-sharing communities in which numerous anonymous users share a variety of resources have been established with the aid of the P2P networks. Users can join the communities with ease without disclosing their identities. However, the openness and anonymity raises the problem of trust, because openness and anonymity also assist malicious users in exploiting the networks and, at the same time, complicate their detection and location. We propose a remedy for this trust problem by introducing a new reputation management model. The unique features of applying reputations to both resources and servents, and dividing the servent reputations into contribution score and evaluation score allow the model to represent the servents' past behavior more accurately. We demonstrate the robustness of our reputation model by subjecting it to several known attacks.