我有下面的代碼。聲明對象C#
於是我就用
if (myObject !=null)
....但是這似乎並沒有工作,因爲它仍然在if語句執行代碼時myObject的值= NULL
if (lawyerResponsibleUserField != null
&& lawyerResponsibleUserField.Id != null)
{
// this effectively assigns Convert.ToString(null)
objLawyerResponsibileValue = Convert.ToString(workflowProperties != null
? workflowProperties.Item[lawyerResponsibleUserField.Id]
: null);
}
if (objLawyerResponsibileValue != null)
{
lawyerResponsibleFieldValue = (SPFieldUserValue)objLawyerResponsibileValue;
}
你能告訴我們一些更全面的代碼? – Crisfole 2011-01-27 14:25:16