# I have a doubt about Ampere's Law

Can I apply Ampere's law if the infinite current carrying wire is not perpendicular to the closed loop along which I calculate the line integral of magnetic field? Will that result in the component of current along the perpendicular direction to the planar loop that I have considered? If so could you provide a general proof or derivation with any general angle between the plane and current carrying wire ?

$$\oint \vec B\cdot d\vec l=\mu_oI_{net}$$
The value $$I_{net}$$ shows that net electric current flowing along normal to the plane of closed loop.
Therefore if the plane of closed loop is inclined to the infinite wire carrying an electric current $$I$$ at an angle say $$\theta$$ then $$I_{net}=I\cos\theta$$ will be net current in this case.