using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; public partial class proov : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { int[] m = { 1, 2, 3, 2 }; GridView1.DataSource = from a in m group a by a into abi from b in abi select b; GridView1.DataBind(); GridView2.DataSource = m.Where(a => (a > 1)); GridView2.DataBind(); DirectoryInfo di = new DirectoryInfo(Server.MapPath("~")); GridView3.DataSource = from f in di.GetFiles() where f.Length > 1000 select f.Name; GridView3.DataBind(); GridView4.DataSource = from f1 in (di.GetFiles()).Union( (from d in di.GetDirectories() from f in d.GetFiles() select f)) select f1.Name; GridView4.DataBind(); GridView5.DataSource = from d in di.GetDirectories() from f in d.GetFiles() select new { fail = f.Name, kataloog = d.Name }; GridView5.DataBind(); GridView6.DataSource = (from d in di.GetDirectories() from f in d.GetFiles() select new { fail = f.Name, kataloog = d.Name }).Union( from f2 in di.GetFiles() select new {fail=f2.Name, kataloog=di.Name } ); GridView6.DataBind(); } }