0
我正在使用System.Windows.SplashScreen来显示启动画面。有一个奇怪的问题。如果图像位于不同的文件夹中,则应用程序会导致IO.IOException(未找到重新找回)。 我试过每种构建类型,并且图像具有完全相同的属性。SplashScreen导致IO.IOException
public class DinSplashScreen
{
private const int SPLASH_SCREEN_FADING_OUT_DURATION = 1000;
private System.Windows.SplashScreen _splash;
public DinSplashScreen()
{
// this works
_splash = new System.Windows.SplashScreen(@"splash.jpg")
// this crashes
_splash = new System.Windows.SplashScreen(@"..\Images\splash.jpg");
}
/// <summary>
/// Shows the splash
/// </summary>
public void Show()
{
if(_splash != null)
{
// here the exception occurs
_splash.Show(true, true);
}
}
像这样使用_splash = new System.Windows.SplashScreen(@“.. \ .. \ Images \ splash.jpg”); – rashfmnb
发布您的文件夹结构。确保图像真的在该文件夹中。 –
路径*不*指向现有图像的任何机会?为什么在应用程序文件夹外寻找一个Image文件夹? –