WebService错误.要搞死....
ainol 2007-05-22 05:51:50
我在本机上做的webservice,测试这个接口没问题,移到另一台机器上就不行了;
framework也是2.0的,不过是英文的.
高手帮忙!!!!
...全文
791 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
j012b 2007-05-24
  • 打赏
  • 举报
回复
英文应该是iis(Windows)版本的问题,不过出现那个提示应该是没赋值便引用造成的
ainol 2007-05-23
  • 打赏
  • 举报
回复
下面是我的接口代码:
string sFileName;
//Object tOj = new Object();
Random tRand;
tRand = new Random();

//Guid tGuid;
//tGuid = new Guid();

sFileName = DateTime.Now.ToString("yyyyMMddhhmmss") + "--Rand=" + tRand.Next(0, 100).ToString() + ".xml";

sFileName += "\n Guid=" + System.Guid.NewGuid().ToString() + "\n";


FileStream myfile = File.OpenRead(m_UpLoadMoviesXmlFileDir + "111.xml");
BinaryReader br = new BinaryReader(myfile);
byte[] btBuf;//=new byte[myfile.Length];
btBuf = br.ReadBytes((int)myfile.Length);
myfile.Close();

//加下面这些就错误了
// m_UpLoadMoviesXmlFileDir = Server.MapPath("/BBoDataBase/UpLoadMoviesXML/");
{
// Random tRand;
// tRand = new Random();
string sFileName2 = DateTime.Now.ToString("yyyyMMddhhmmss") + "-" + tRand.Next(0, 100).ToString() + ".xml";

string sReportXmlFn;
sReportXmlFn = m_UpLoadMoviesXmlFileDir + sFileName2;

FileStream fileStream = null;
try
{
fileStream = new FileStream(sReportXmlFn, FileMode.Create, FileAccess.Write);
//write the file
fileStream.Write(btBuf, 0, btBuf.Length);
fileStream.Flush();//clear the buffer,write the data to the hard disk
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
fileStream.Close();
}
}
ainol 2007-05-23
  • 打赏
  • 举报
回复
为什么在本机上是正常的呢? 我重装了一下中文版的还是不可以!
Object reference not set to an instance of an object.

只在此山中 2007-05-23
  • 打赏
  • 举报
回复
就是有个对象没有被初始化
ainol 2007-05-23
  • 打赏
  • 举报
回复
没人回答?

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧