I am using the following code
WindowsIdentity wIdb4 = WindowsIdentity.GetCurrent();
string name = wIdb4.Name;
in a workflow to show which user account is being used to upload a document. When i write the above mentioned string in a workflow history event, it always returns NETWORK SERVICE, even if i am logged in using the site collection administrator. Can anyone tell me why is this so?