Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                if (FileUploadControl.HasFile)
                {
                    try
                    {
                        string filename = Path.GetFileName(FileUploadControl.FileName);
                        FileUploadControl.SaveAs(Server.MapPath("~/") + filename);
                        StatusLabel.Text = "Upload status: File uploaded!";
                        string       toRead = Server.MapPath(FileUploadControl.FileName);
                        StreamReader reader = File.OpenText(toRead);
                        string       line;
                        while ((line = reader.ReadLine()) != null)
                        {
                            StaticSession.ws.receiveMessage(line);
                        }
                        reader.Close();
                    }
                    catch (Exception ex)
                    {
                        StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
                    }
                }
            }
            GenerateDot gen = new GenerateDot();
            String      s   = StaticSession.ws.graphAvlTree();

            gen.createDot(s, "avlTree");
            s = StaticSession.ws.sendArbolB();
            gen.createDot(s, "btree");
            s = StaticSession.ws.sendHashGraph();
            gen.createDot(s, "hashTable");
        }
Example #2
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            String      s   = StaticSession.ws.sendWhishGraph(StaticSession.user);
            GenerateDot gen = new GenerateDot();

            gen.createDot(s, "whish");
            DataTable dt = new DataTable();

            dt.Columns.Add("Value");
            DataRow dr = dt.NewRow();

            dr["Value"] = "images\\whish.png";
            dt.Rows.Add(dr);
            GridView1.DataSource = dt;
            GridView1.DataBind();
            GridView1.HeaderRow.Cells[0].Visible = false;
            foreach (GridViewRow gvr in GridView1.Rows)
            {
                gvr.Cells[1].Visible = false;
            }
        }