vertex shader problem

How to pass lighting parameters to vertex shader program ?
For example, I have some lights on the scene, then calculate the lighting ,The problem is how to obtain the light parameters?

Can you explain the problem in more details?

Try looking at the code here.

This does ambient, vertex lights, spherical harmonics, 1 pixel directional light with shadows (as a base pass). And then 1 pixel light without shadows (as an extra pass per light).

http://forum.unity3d.com/threads/108612-Adding-shadows-to-custom-shader-(vert-frag)?p=724147&viewfull=1#post724147

Thank you, but I still have a few questions:
1, in your code, the prefix is “UNITY_” what it is? , Who give it value? For example: UNITY_LIGHTMODEL_AMBIENT, UNITY_MATRIX_MVP, as well: _Object2World
2, in front of the fragment program, you define a variable: “float4 _LightColor0”, then you are using _LightColor0.rgb in the fragment program . This variable is not initialized, its value come from?

I wrote the CG code in D3D program, the parameter is passed by the application, such as light and matrix, in unity, I am depressed, I hope you can help me, waste your valuable time, very sorry