Это старый вопрос, но я все время сталкивался с ним, пытаясь найти решение для WPF с многопоточным экраном, которое могло бы включать анимацию.
Вот что я в итоге собрал вместе:
App.XAML:
<Application Startup="ApplicationStart" …
App.XAML.cs:
void ApplicationStart(object sender, StartupEventArgs e)
{
var thread = new Thread(() =>
{
Dispatcher.CurrentDispatcher.BeginInvoke ((Action)(() => new MySplashForm().Show()));
Dispatcher.Run();
});
thread.SetApartmentState(ApartmentState.STA);
thread.IsBackground = true;
thread.Start();
// call synchronous configuration process
// and declare/get reference to "main form"
thread.Abort();
mainForm.Show();
mainForm.Activate();
}
Вы должны пройти через FileItemIterator. В приведенном вами примере обрабатывается только изображение ( FileItemStream imageItm = iter.next ();
).
// From the example: http://stackoverflow.com/questions/1513603/how-to-upload-and-store-an-image-with-google-app-engine-java
FileItemIterator iter = upload.getItemIterator(req);
// Parse the request
while (iter.hasNext()) {
FileItemStream item = iter.next();
String name = item.getFieldName();
InputStream stream = item.openStream();
if (item.isFormField()) {
System.out.println("Form field " + name + " with value "
+ Streams.asString(stream) + " detected.");
} else {
// Image here.
System.out.println("File field " + name + " with file name "
+ item.getName() + " detected.");
// Process the input stream
...
}
}
См. http://www.jguru.com/faq/view.jsp?EID=1045507 для получения дополнительной информации.