I want to replace a DispForm.aspx of a list (SharePoint 2010) - so I did the following:
string path = string.Format("Lists/{0}/DispForm.aspx", "MyList");
SPFile file = web.GetFile(path);
file.SaveBinary(File.ReadAllBytes(@"C:\DispForm_ProcessList.aspx"));
Unfortunately, now is the DispForm.aspx of the list is no longer associated with it. (I can find the DispForm.aspx file using the sharepoint designer below "all items\lists\MyList")