تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] ارجو برمجة الكود فى webservice
#1
السلام عليكم رجاء برمجة الكوود فى ويب سيرفس
الكود يقوم بانشاء قاعدة بيانات باسم مستخدم وكلمة سر
ويمكن تسجيل عضو جديد
وتسجيل الدخول
PHP كود :
Public str As String "server=.\sqlexpress;initial catalog=pics;integrated security=true;"
    
Public con As New SqlConnection(str)

    Public Function 
isdbfound(ByVal constr As StringByVal dbname As String) As Boolean
        Dim mc 
As New SqlConnection(constr)
        
Dim a As New SqlCommand("select count(name) from master.dbo.sysdatabases where name='" dbname "'"mc)
        If 
mc.State ConnectionState.Closed Then
            mc
.Open()
        
End If

        If 
a.ExecuteScalar <= 0 Then
            
Return False
        
Else
            Return 
True
        End 
If
    
End Function
    
    Public Function 
istbfound(ByVal tb As String) As Boolean
        Dim m 
As New SqlCommand("select count(name) from sys.tables where name='" tb "'"con)
        If 
con.State ConnectionState.Closed Then
            con
.Open()
        
End If

        If 
m.ExecuteScalar <= 0 Then
            
Return False
        
Else
            Return 
True
        End 
If
    
End Function

    Function 
istusersfound(ByVal tb As String) As Boolean
        Dim m 
As New SqlCommand("select count(name) from sys.tables where name='" tb "'"con)
        If 
con.State ConnectionState.Closed Then
            con
.Open()
        
End If

        If 
m.ExecuteScalar <= 0 Then
            
Return False
        
Else
            Return 
True
        End 
If
    
End Function

    
Sub ctusers()
        If 
istusersfound("tusers") = False Then
            Dim i 
As New SqlCommand("create table tusers(tid int NOT NULL PRIMARY KEY identity,un varchar(200),ps varchar(200))"con)
            If 
con.State ConnectionState.Closed Then
                con
.Open()
            
End If
            Try
                
i.ExecuteNonQuery()
            Catch 
ex As Exception
                MsgBox
(Err.DescriptionMsgBoxStyle.Critical"")
            
End Try

        
End If
    
End Sub





    Sub cdb
()
        
Dim mcc As New SqlConnection("server=.\sqlexpress;integrated security=true;")
        If 
isdbfound("server=.\sqlexpress;integrated security=true;""pics") = False Then
            Dim cc 
As New SqlCommand("CREATE DATABASE pics"mcc)
            If 
mcc.State ConnectionState.Closed Then
                mcc
.Open()
            
End If
            
cc.ExecuteNonQuery()

        
End If

    
End Sub
    Sub ctb
()
        If 
istbfound("pic") = False Then
            Dim i 
As New SqlCommand("create table pic(tid int NOT NULL PRIMARY KEY identity,mgid varchar(200),mg varbinary(max))"con)
            If 
con.State ConnectionState.Closed Then
                con
.Open()
            
End If
            Try
                
i.ExecuteNonQuery()
            Catch 
ex As Exception
                MsgBox
(Err.DescriptionMsgBoxStyle.Critical"")
            
End Try

        
End If
    
End Sub


    
Function addme(ByVal un As TextBoxByVal ps As TextBox) As Boolean
        Dim cm 
As New SqlCommand("insert into tusers(un,ps) values(@un,@ps)"con)
        
cm.Parameters.AddWithValue("@un"un.Text)
        
cm.Parameters.AddWithValue("@ps"ps.Text)
        If 
con.State ConnectionState.Closed Then
            con
.Open()
        
End If
        Try
            
cm.ExecuteNonQuery()
            Return 
True
        
Catch ex As Exception
            
Return False
        End 
Try
    
End Function



    Function 
isok(ByVal un As TextBoxByVal ps As TextBox) As Boolean
        Dim cm 
As New SqlCommand("select count(un) from tusers where un=@un and ps=@ps"con)
        
cm.Parameters.AddWithValue("@un"un.Text)
        
cm.Parameters.AddWithValue("@ps"ps.Text)
        If 
con.State ConnectionState.Closed Then
            con
.Open()
        
End If
        Try
            If 
cm.ExecuteScalar <= 0 Then
                
Return False
            
Else
                Return 
True
            End 
If

        Catch 
ex As Exception
            
Return False
        End 
Try
    
End Function 
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
Information ما هو الخطاء في الكود ProgressBar1 Mostafa201255411 1 191 26-11-25, 08:19 PM
آخر رد: asmarsou
  [VB.NET] مساعدة تعديل على الكود ZEEN4ZEEN 2 210 08-10-25, 02:20 PM
آخر رد: salamandal
Rainbow [كود] تصحيح الخطاء في الكود محمد مسافر 2 1,051 28-08-25, 09:13 AM
آخر رد: محمد مسافر
Rainbow [كود] تصحيح الخطاء في الكود محمد مسافر 0 841 27-08-25, 04:05 PM
آخر رد: محمد مسافر
  [VB.NET] رجاء لخبير برمجة كريم Mostafa25 1 630 21-07-25, 03:22 AM
آخر رد: Taha Okla
  ما هو الخطأ فى هذا الكود خالد كامل1 10 1,140 28-05-25, 09:16 PM
آخر رد: خالد كامل1
  ارجو تعديل الكود بواستطة الاجراء المخزن new_programer 3 676 03-04-25, 02:44 PM
آخر رد: princelovelorn
  مساعدة في تحويل الكود من فيجوال بسيك 6 الى فيجوال دوت نت سيد أحمد 5 820 23-03-25, 10:54 PM
آخر رد: سيد أحمد
  ارجو تعديل الكود جلب البيانات عن طريق اجراء مخزن - مرفق مثال new_programer 0 620 05-02-25, 01:51 AM
آخر رد: new_programer
  ارجو تقيم الكود المرفق - جلب اعلي رقم لتسلسل نصي للباركود new_programer 4 604 30-01-25, 08:26 AM
آخر رد: new_programer

التنقل السريع :


يقوم بقرائة الموضوع: