Use of Unassigned local variable

前端 未结 3 1305
离开以前
离开以前 2021-01-26 11:52

I encountered an error. Despite declaring the variables (failturetext and userName) errors still appear. Can anyone please help me?

- Use of Unassigned local va         


        
3条回答
  •  忘掉有多难
    2021-01-26 12:05

    Regarding the compiler message - look at this link

     TextBox FailureText; - you declared a variable, but it is not initialized. you might set it to null / a value / default() - but you must initialize it
     TextBox UserName; - the same
    

    when you call UserName.Text - the compiler alerts for the uninitialized UserName

提交回复
热议问题