In P2P networks, peers generally interact with unknown or unfamiliar peers without trusted third parties that can manage the behaviors of peers or control the malicious peers. They can give harm to correct peers by providing inauthentic resources for the benefit of themselves in resource sharing. Under this situation, peers can refer the reputation that reflects peer's past behaviors to download the authentic resources from reliable peers. P2P networks utilize mainly a reputation to provide shared resources and peers with trustworthiness, many schemes available in literature have been proposed to manage of reputation. In this paper, we propose a new reputation management scheme to improve the trustworthiness of peers and shared resources, and restrain the participation of free-riders. In the proposed scheme, we update the good and bad reputation of peer according to the rating that peer received from the t(n) and t(n+1) transaction. And, we can lead to the increment or decrement of reputation by reflecting the ratio of shared resources when calculate the good and bad reputation of peer. The reputation makes an impact on the calculation of trust value of peers. Also, we can restrain the participation of free-riders who does not contribute resources and malicious peers by exploiting this value. Therefore, the proposed scheme can improve the performance of resource sharing system.