\(ab=bc=ca\Rightarrow\frac{ab}{abc}=\frac{bc}{abc}=\frac{ca}{abc}\)
\(\Rightarrow\frac{1}{c}=\frac{1}{a}=\frac{1}{b}\Rightarrow a=b=c\)
\(\Rightarrow M=\left(\frac{a}{b}\right)^{2016}-\left(\frac{c}{a}\right)^{2017}\)
\(=\left(\frac{a}{a}\right)^{2016}-\left(\frac{a}{a}\right)^{2017}\)
\(=1^{2016}-1^{2017}\)
\(=1-1=0\)