Software Program of Water and Wastewater Network Optimization Was Provided and Was Applied in Petrochemical Enterprise. a New Water System Optimization Method Was Based on Mass Transfer Model of Water Pinch Technology, Evry Operation Used Matched Water of Circle Water and Fresh Water in Turn. Judgement Basis of Operation Sequence and Theoretical Basis of Selection of Water Source Was Put Forward. the Water Network Optimization Program of Matlab Language Was Edited and Applied in a Petrochemical Enterprise. the Result Showed that the Fresh Water Reduction Was 38.31% when the Optimization Method Was Used in one Water System Contaminanted by Sulfur with Nine Operations.