Avance Zone

Technical Experts Zone Blogs

C sharp HTML Searching Method

This program helps in understanding the c sharp HTML Searching Method

 
 
 
 
<html>
 
<form action= http://127.0.0.1/cgi-bin/search.exe >
 
<b> Enter keyword </b>
 
<input type=text name=aa> <p>
 
<input type=submit value="Search">
 
<form>
 
</html>
 
//c# Code
using System.Data.OleDb;
 
class zzz
 
{
 
public static void Main()
 
{
 
try
 
{
 
string t;
 
t=System.Environment.GetEnvironmentVariable("QUERY_STRING");
 
string [] u;
 
char [] v = new char[1];
 
v[0] = '=';
 
u = t.Split(v);
 
string w;
 
System.Console.WriteLine("Content-Type:text/html\n");
 
w = "select * from search where keyword='" + u[1] + "'";
 
OleDbConnection s;
 
s = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=zzz.mdb");
 
s.Open();
 
OleDbCommand c;
 
c=new OleDbCommand(w,s);
 
OleDbDataReader r;
 
r = c.ExecuteReader();
 
while ( r.Read() )
 
{
 
System.Console.WriteLine("<a href=/{0}> {1} </a>  {2}  <br>",r.GetValue(1),r.GetValue(2),r.GetValue(3));
 
}
if(u[1]!="java" && u[1]!="php" && u[1]!="csharp" && u[1]!="html")
{
System.Console.WriteLine("<h1>Sorry Not Matching the Criteria</h1>");
}
}
 
catch(System.Exception e)
 
{
 
System.Console.WriteLine(e.ToString());
 
}
 
}
 
}

C sharp Html Connection

This program helps in understanding the c sharp Html Connection

 
<html>
<form action=http://127.0.0.1/cgi-bin/test.exe>
<input type=submit value=Search>
<form>
</html>
 
//C# code
 
class zzz
 
{
 
public static void Main(){
 
System.Collections.IDictionary i,t,KARTHIK;
 
i=System.Environment.GetEnvironmentVariables ();
 
System.Collections.IDictionaryEnumerator d;
 
d=i.GetEnumerator();
t.Add(KARTHIK,54);
System.Console.WriteLine("Content-Type:text/html\n");
 
System.Console.WriteLine("Total Environmental Variables "+i.Count + "<br>");
 
while (d.MoveNext())
 
{
 
System.Console.WriteLine("{0} = {1}<br>",d.Key,d.Value);
 
}
 
}
 
}

c sharp HTML Connection

This program helps in understanding the c sharp HTML Connection

 
 
<html>
 
<form action= http://127.0.0.1/cgi-bin/nine.exe >
 
<b> Enter Table Name </b>
 
<input type=text name=aa> <p>
 
<input type=submit value="Show Table">
 
<form>
 
</html>
// C# Code 
 
using System.Data.OleDb;
using System;
class zzz
 
{
 
public static void Main()
 
{
 
try
 
{
 
string t;
t=System.Environment.GetEnvironmentVariable("QUERY_STRING");
string [] u;
 
char [] v = new char[1];
 
v[0] = '=';
 
u = t.Split(v);
 
string w;
 
w = "select * from " + u[1];
 
OleDbConnection s;
 
s = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\zzz.mdb");
 
s.Open();
 
OleDbCommand c;
 
c=new OleDbCommand(w,s);
 
OleDbDataReader r;
 
r = c.ExecuteReader();
 
System.Console.WriteLine("Content-Type:text/html\n");
 
System.Console.WriteLine("<table border=10><thead><th>Vno</th><th>Name</th></thead>");
 
while ( r.Read() )
 
{
 
System.Console.WriteLine("<tr>");
 
for ( int i = 0 ; i < r.FieldCount ; i++) {
 
System.Console.Write("<td>" + r.GetValue(i) + "</td>");
 
}
 
System.Console.WriteLine("</tr>");
 
}
 
System.Console.WriteLine("</table>");
 
}
 
catch(System.Exception e)
 
{
 
System.Console.WriteLine(e.ToString());
 
}
 
}
 
}

c sharp HTML Connection

This program helps in understanding the c sharp HTML Connection

 
<html>
 
<form action= http://127.0.0.1/cgi-bin/eight.exe >
 
<b> Enter Table Name </b>
 
<input type=text name=aa> <p>
 
<input type=submit value="Show Table">
 
<form>
 
</html>
 
 
 
 
//C # code
using System.Data.OleDb;
class zzz
 
{
 
public static void Main()
 
{
 
try
 
{
 
string t;
 
t=System.Environment.GetEnvironmentVariable("QUERY_STRING");
 
string [] u;
 
char [] v = new char[1];
 
v[0] = '=';
 
u = t.Split(v);
 
string w;
 
w = "select * from " + u[1];
 
OleDbConnection s;
 
s = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\zzz.mdb");
 
s.Open();
 
OleDbCommand c;
 
c=new OleDbCommand(w,s);
 
OleDbDataReader r;
 
r = c.ExecuteReader();
 
System.Console.WriteLine("Content-Type:text/html\n");
 
while ( r.Read() )
 
{
 
for ( int i = 0 ; i < r.FieldCount ; i++)
 
System.Console.Write(r.GetValue(i)+" ");
 
System.Console.WriteLine("<br>");
 
}
 
}
 
catch(System.Exception e)
 
{
 
System.Console.WriteLine(e.ToString());
 
}
 
}
 
}

C sharp Html Connection

This program helps in understanding the c sharp Html Connection

using System;
class zzz
{
public static void Main()
{
string t;
int a,b,c;
System.Console.WriteLine("Content-Type:text/html\n");
t=System.Environment.GetEnvironmentVariable("QUERY_STRING");
string [] u;
char [] v = new char[2];
v[0] = '=';
v[1] = '&';
u = t.Split(v);
a=Int32.Parse(u[1]);
b=Int32.Parse(u[3]);
c=a+b;
System.Console.WriteLine("<h1>Addition of {0} and {1} is {2}</h1>",a,b,c);
}  
}

c sharp using Html

This program helps in understanding the c sharp using Html

<html>
 
<form action= http://127.0.0.1/cgi-bin/six.exe >
 
<b> Enter the number </b>
 
<input type=text name=aa> <p>
 
<input type=submit value="Show Table">
 
<form>
 
</html>
 
// C # coding
using System;
class zzz
{
public static void Main()
{
string t;
int n;
System.Console.WriteLine("Content-Type:text/html\n");
t=System.Environment.GetEnvironmentVariable("QUERY_STRING");
string [] u;
char [] v = new char[1];
v[0] = '=';
u = t.Split(v);
n=Int32.Parse(u[1]);
System.Console.WriteLine("<center><h1>Multiplication Table for {0} </h1></center>",n);
for(int i=1;i<=12;i++)
{
System.Console.WriteLine("<font color='red' size=6>{0} * {1} = {2} </font><br>",n,i,n*i);
}
}
 
}

c sharp Connection with HTML

This program helps in understanding the c sharp Connection with HTML

<html>
<form action=http://127.0.0.1/cgi-bin/five.exe>
<input type=submit value=Search>
<form>
</html>
 
class zzz
 
{
 
public static void Main(){
 
System.Collections.IDictionary i;
 
i=System.Environment.GetEnvironmentVariables ();
 
System.Collections.IDictionaryEnumerator d;
 
d=i.GetEnumerator();
 
System.Console.WriteLine("Content-Type:text/html\n");
 
System.Console.WriteLine("Total Environmental Variables "+i.Count + "<br>");
 
while (d.MoveNext())
 
{
 
System.Console.WriteLine("{0} = {1}<br>",d.Key,d.Value);
 
}
 
}
 
}

C sharp (HTML Connection With Ms Access)

This program helps in understanding the c sharp
This program helps in understanding the c sharp (HTML With Ms Access)

<html>
<form action=http://127.0.0.1/cgi-bin/three.exe>
<input type=submit value=Search>
<form>
</html>
 
// c# File
using System.Data.OleDb;
 
class zzz
 
{
 
public static void Main()
 
{
 
try
 
{
 
OleDbConnection s;
 
s = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\zzz.mdb");
 
s.Open();
 
OleDbCommand c;
 
c=new OleDbCommand("select * from a1",s);
 
OleDbDataReader r;
 
r = c.ExecuteReader();
 
System.Console.WriteLine("Content-Type:text/html\n");
 
while ( r.Read() )
 
{
 
for ( int i = 0 ; i < r.FieldCount ; i++)
 
System.Console.Write(r.GetValue(i)+" ");
 
System.Console.WriteLine("<br>");
 
}
 
}
 
catch(System.Exception e)
 
{
 
System.Console.WriteLine(e.ToString());
 
}
 
}
 
}

c sharp with Html

This program helps in understanding the c sharp with Html

<html>
<form action=http://127.0.0.1/cgi-bin/two.exe>
<input type=submit value=Search>
<form>
</html>
 
class zzz
{
public static void Main()
{
System.Console.WriteLine("Content-Type:text/html\n");
System.Console.WriteLine("<center><h1>Multiplication Table</h1></center>");
int n=3;
for(int i=1;i<=12;i++)
{
System.Console.WriteLine("<font color='red' size=4>{0} * {1} = {2} </font><br>",n,i,n*i);
}
 
}
 
}

c sharp with Html Example

This program helps in understanding the c sharp with Html

 
class zzz
{
public static void Main()
{
System.Console.WriteLine("Content-Type:text/html\n");
System.Console.WriteLine("<center><h1>Multiplication Table</h1></center>");
int n=3;
for(int i=1;i<=12;i++)
{
System.Console.WriteLine("<font color='red' size=4>{0} * {1} = {2} </font><br>",n,i,n*i);
}
 
}
 
}