Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


ASP.NET C # UPLOAD and LOGIN and SmtpMail, C#, c#


ASP.NET C # UPLOAD and LOGIN and SmtpMail, C#, c#

Author
Message
senol
senol
Forum God
Forum God (1.6K reputation)Forum God (1.6K reputation)Forum God (1.6K reputation)Forum God (1.6K reputation)Forum God (1.6K reputation)Forum God (1.6K reputation)Forum God (1.6K reputation)Forum God (1.6K reputation)Forum God (1.6K reputation)

Group: Forum Members
Posts: 7, Visits: 71
UPLOAD


bu class
public static void ResimYükle(HtmlInputFile HtmlInput, string id,string Klasor,string KatID)

{

string path_file;

path_file = id;

string KlasorAdi;

KlasorAdi = Klasor;

string Kat_ID;

Kat_ID = KatID;

if (HtmlInput.PostedFile.FileName.ToString() != "")

{

Directory.CreateDirectory(HttpContext.Current.Serv er.MapPath("FirmaSiteleri/" + path_file + "/" + KlasorAdi + "/" + Kat_ID));//KLASÖR OLUŞTUR

HtmlInput.PostedFile.SaveAs(HttpContext.Current.Se rver.MapPath("FirmaSiteleri/" + path_file + "/" + KlasorAdi + "/" + Kat_ID + "/" +

Path.GetFileName(HtmlInput.PostedFile.FileName)

));// İLGİLİ KAYDET

}

}

bu dizayn
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BenimSayfamLogo.aspx.cs" Inherits="BenimSayfamLogo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Logo</title>

</head>

<body>

<form~/BenimSayfam.aspx">Önceki Sayfaya Geç</asp:HyperLink>

&nbsp; &nbsp;

<asp:HyperLink~/BenimsayfamKategoriHakkimizda.aspx"

Width="191px">Hakkımızda Sayfasına Dön</asp:HyperLink><br />

<br />

&nbsp;&nbsp; Firma Logonuz

<input /><br />

<br />

</div>

</form>

</body>

</html>

cs codu
using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.IO;

using System.Text;

public partial class BenimSayfamLogo : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

if (Session["ID"] != null)

{

}

else

{

Response.Redirect("Default.aspx");

}

}

protected void Button1_Click(object sender, EventArgs e)

{

if (Path.GetExtension(File1.PostedFile.FileName) == ".gif" || Path.GetExtension(File1.PostedFile.FileName) == ".jpg")

{

baglantitable.Sorgu_Calistir("Update tbl_firma set firmalogo=’" + Path.GetFileName(File1.PostedFile.FileName) + "’ where["ID"]);

baglantitable.ResimYükle(File1, Session["ID"].ToString(), "Logo", Session["ID"].ToString());

}

else

{

string hataAc;

hataAc = "<script>" + "alert(’Logo Resmi Jpg veya Gif Resmi Seçmelisiniz !’)" + "</script>";

Page.RegisterStartupScript("JavaScript", hataAc.ToString());

}

}

}





LOGiN

al kadeşim

user ve pass sorguladıktan sonra hadi onuda eklim

al bu class

public static Boolean Oturumu_Ac(string Table_name, string User_Name, string User_pass)

{

MySqlCommand Oturum_sql = new MySqlCommand("select * from " + Table_name + " where lbl_k=’" + User_Name + "’ and sifre=’" + User_pass + "’ and site=’2′ ", sqlBaglanti);

if (Oturum_sql.Connection.State == ConnectionState.Closed)

{

sqlBaglanti.Open();

}

MySqlDataReader sql_oku = Oturum_sql.ExecuteReader();

if (sql_oku.Read())

{

HttpContext.Current.Session["ID"] = sql_oku["id"].ToString();

sqlBaglanti.Close();

return true;

}

else

{

sqlBaglanti.Close();

return false;

}

}

al bu cs

if (baglantitable.Oturumu_Ac("tablo", txtKullanici.Text, txtSifre.Text) == true)

{

Session["Login"] = "true";

Response.Redirect("musteri.aspx");

}

else

{

Session["Login"] = "false";

lblHata.Visible = true;

lblHata.Text = "LÜTFEN KULLANICI ADI VE ŞİFRENİZİ DOĞRU GİRİNİZ !";

}

buda diyer sayfalara geçinde Session kontrolu,,
protected void Page_Load(object sender, EventArgs e)
{

if (Session["ID"] != null)

{

}

else

{

Response.Redirect("Default.aspx");

}

}

bu kadar bilgi nerde

mail

using System.Web.Mail;

MailMessage mailObj = new MailMessage();

MailMessage bize = new MailMessage();

mailObj.From = "bravilor@bravilorturkiye.com";

mailObj.To = TextBox2.Text;

mailObj.Subject = "Bravilor Türkiye Fiyat Listesi ";

mailObj.Body = "<strong>Bizi Tercih Ettiğiniz İçin Teşşekür Ederiz En Yakın Zamanda Size Geri Döneceğiz !</strong>";

mailObj.BodyFormat = MailFormat.Html;

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(mailObj);

bize.From = TextBox2.Text;

bize.To = "bravilor@bravilorturkiye.com";

bize.Subject = "Bravilor Türkiye Yeni Fiyat Talebi";

bize.Body = "<strong>Fiyat Talep Var </strong>";

bize.BodyFormat = MailFormat.Html;

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(bize);



THANKS a1vbcode.com
MY WEB PAGE
paslanmaz boru




jaineel
jaineel
Forum God
Forum God (776 reputation)Forum God (776 reputation)Forum God (776 reputation)Forum God (776 reputation)Forum God (776 reputation)Forum God (776 reputation)Forum God (776 reputation)Forum God (776 reputation)Forum God (776 reputation)

Group: Forum Members
Posts: 2, Visits: 4
my project is on bill approval system basically a work-flow process. I am building it in ASP .Net using either vb or c# with SQL Server 2005.(VS 2008)
                    My main doubt is:
 
When the employeer selects to upload a bill and fills the details within it, he is suppose to send it to his respective head of department. There will be thousands of employees with many head of departments each of them having a different login. Now the bill should be in the particular head of department's login only. I am building it on  SINGLE machine.
So how do I prepare a code such that the bill passes to a specific user's login only and also he can approve and comment on receving the bill.


-jaineel
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search