나는 C# .net 4.0을 사용하고 그것을 할 수있는 어떤 방법도 보이지 않지만 어쩌면 알 수 있을까? :)
내가 그런 식으로 내 직렬화를 수행합니다 나는 생각하지 않는다ProgressBar에 표시하기 위해 직렬화 시간을 계산하거나 얻는 방법이 있습니까?
public static void SaveCollection<T>(string file_name, T list)
{
BinaryFormatter bf = new BinaryFormatter();
FileStream fs = null;
try
{
fs = new FileStream(Application.StartupPath + "/" + file_name, FileMode.Create);
bf.Serialize(fs, list);
fs.Flush();
fs.Close();
}
catch (Exception exc)
{
if (fs != null)
fs.Close();
string msg = "Unable to save collection {0}\nThe error is {1}";
MessageBox.Show(Form1.ActiveForm, string.Format(msg, file_name, exc.Message));
}
}
와우. 벽 시계에서 실제로 시간을 측정 할 수 있도록 너무 큰 것을 직렬화하고 있습니까? XML 직렬화 작업을하고 있습니까? – aquinas
ehm 예, 직렬화 가능한 것들 중 일부는 최대 1 분이 걸릴 수 있습니다. 이것은 바이너리 직렬화입니다 :) 단지 많은 객체가 있습니다. – Kosmos
직렬화 될 때 객체의 크기는 얼마나됩니까? (평균적으로) – aquinas