Grasshopper C# How to control each sliders separately

Hi all I have some very simple question.
I’m currently start learning c# in grasshopper.

According the code I found in this forum.
which is to control “all” the sliders that were input in the same time.

How could I access each slider separately?

For example, as In the picture, what if I want to just change value for slider[0], slider[2] by the value the was input, not all of them?

Thank you

Atm you have a for loop for each slider input.
So you change all slider. I‘m not very experienced with c#, but in python I would create a list of integers which should be changed and loop over them. For example:

listToChange = [0,1,5]
for index in listToChange:

You should not modify values from within a solution. Your RunScript() method is called as part of the solution and if it starts modifying things then you get solutions from within other solutions and that the way of pain.

Changes to the file must be made before or after solutions. For example form within your script you can schedule a solution in the future and provide a callback method. This callback is invoked just before the scheduled solution starts meaning you can make all the changes you like.