2013-04-22 55 views
0

使用zedGargh.dll我想在asp.net 4.使用zedgraph但我得到误差修改如下:错误而ASP.NET4

System.IO.DirectoryNotFoundException

Could not find a part of the path C:\Users\stn-1\Desktop\ZedGraphWebAp1_CompiledSite8 \ZedGraphImages\ZedGraphWeb1fc6eb2c0-023a-4818-bff9-9c957971af4b.png。 (System.IO.FileStream.Init(String path,FileMode mode,FileAccess access,Int32 rights,Boolean useRights,FileShare share,Int32 bufferSize,FileOptions选项,SECURITY_ATTRIBUTES secAttrs)上System.IO.__错误.WinIOError(Int32错误码,字符串maybeFullPath) ,字符串MSGPATH,布尔bFromProxy,布尔useLongPath)在System.IO.FileStream..ctor(字符串路径,的FileMode模式,FileAccess的访问,文件共享股)ZedGraph.Web.ZedGraphWeb.Render(HtmlTextWriter的输出)

我使用下面的代码:

protected void ZedGraphWeb1_RenderGraph(ZedGraphWeb webObject, System.Drawing.Graphics g, MasterPane pane) 
{ 
    GraphPane myPane = pane[0]; 

    myPane.Title.Text = "Title"; 
    myPane.XAxis.Title.Text = "X axis label"; 
    myPane.YAxis.Title.Text = "Y axis label"; 

    PointPairList list1 = new PointPairList(); 

    for (int i = 0; i < 10; i++) 
    { 
     double x = Convert.ToDouble(i); 
     double y = x * x; 
     list1.Add(x, y); 
    } 

    string textForLegend = "x-squared"; 
    myPane.CurveList.Clear(); 
    LineItem myCurve = myPane.AddCurve(textForLegend, 
     list1, Color.Red, SymbolType.Diamond); 
    myCurve.Symbol.IsVisible = true; 

} 

回答

3

的原因是,zedgraph不会自动在根文件夹中创建一个文件夹名“ZedGraphImages” ...你应该手动创建...