标题:未将对象引用设置到对象实例?
取消只看楼主
tudou2xigua
Rank: 2
等 级:论坛游民
帖 子:87
专家分:54
注 册:2011-3-20
结帖率:90.32%
已结贴  问题点数:20 回复次数:1 
未将对象引用设置到对象实例?
运行后提示这个错误,看了半天都不知道哪边出了问题。求高手指点,感激不敬

FileSystemInfo[] FSInfo;
string Fpath;
string path;
int i=0;

private void GetPic()
        {
            if(i<FSInfo.Length)
            {
                string FileType=FSInfo[i].ToString().Substring(FSInfo[i].ToString().LastIndexOf(".")+1);
                FileType=FileType.ToLower();
                if(FileType=="bmp"||FileType=="gif"||FileType=="jpeg"||FileType=="png")
                    pictureBox1.Image=Image.FromFile(Fpath+FSInfo[i].ToString());
            }
        }

        private void menuItem2_Click(object sender, System.EventArgs e)
        {
            if(folderBrowserDialog1.ShowDialog()==DialogResult.OK)
            {
                path=folderBrowserDialog1.SelectedPath;
                DirectoryInfo dir=new DirectoryInfo(path);
                FSInfo=dir.GetFileSystemInfos();
                if(path.Length<=4)
                    Fpath=path;
                else
                    Fpath=path+"\\";
            }
        }

        private void timer1_Tick(object sender, System.EventArgs e)
        {
            GetPic();
            if(i==FSInfo.Length-1)
                i=0;
            else
                i++;
        }
搜索更多相关主题的帖子: private 
2011-09-24 20:44
tudou2xigua
Rank: 2
等 级:论坛游民
帖 子:87
专家分:54
注 册:2011-3-20
得分:0 
回复 2楼 qq1023569223
谢谢!
2011-09-25 09:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-350776-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.096801 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved