Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > .net ช่วยแนะนำการแสดงรูปจาก mysql ลง picturebox หน่อยคร่า c#



 

.net ช่วยแนะนำการแสดงรูปจาก mysql ลง picturebox หน่อยคร่า c#

 



Topic : 100682

Guest




ช่วยแนะนำการแสดงรูปจาก mysql ลง picturebox หน่อยคร่า c#
ใน ดาต้าเบส เก็บเปง string คร่า ขอบคุรล่วงหน้าน๊ค๊



Tag : .NET, C#







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-09-19 09:20:56 By : ++++ View : 1081 Reply : 6
 

 

No. 1

Guest


Copy มาจาก Internet ตั้งแต่ปีมะโว้น้องฯชาติที่แล้ว จนผมจำไม่ได้ว่าเอามาจากไหน

Code (VB.NET)
Imports System
Imports System.IO
Imports System.Drawing
Imports System.Drawing.Imaging

Public Class ImageHelper
    ' Convert an image to a Base64 string by using a MemoryStream. Save the
    ' image to the MemoryStream and use Convert.ToBase64String to convert
    ' the content of that MemoryStream to a Base64 string.
    Public Shared Function ImageToBase64String(ByVal img As Image, ByVal imgFormat As ImageFormat)
        Using ms As New MemoryStream
            img.Save(ms, imgFormat)
            Dim result As String = Convert.ToBase64String(ms.ToArray())
            'ms.Close()
            Return result
        End Using
    End Function

    ' Convert a Base64 string back to an image. Fill a MemoryStream based
    ' on the Base64 string and call the Image.FromStream() methode to
    ' convert the content of the MemoryStream to an image.
    Public Shared Function ImageFromBase64String(ByVal base64 As String)
        Using ms As New MemoryStream(Convert.FromBase64String(base64))
            Dim result As Image = Image.FromStream(ms)
            'ms.Close()
            Return result
        End Using
    End Function

End Class







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-19 09:45:58 By : ผ่านมา
 


 

No. 2

Guest


Code (C#)
using System;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
public class ImageHelper
{
    public static object ImageToBase64String(Image img, ImageFormat imgFormat)
    {
        using (MemoryStream ms = new MemoryStream())
        {
            img.Save(ms, imgFormat);
            string result = Convert.ToBase64String(ms.ToArray());
            return result;
        }
    }
    public static object ImageFromBase64String(string base64)
    {
        using (MemoryStream ms = new MemoryStream(Convert.FromBase64String(base64)))
        {
            Image result = Image.FromStream(ms);
            return result;
        }
    }
}

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-19 09:51:53 By : ผ่านมา
 

 

No. 3

Guest


ถ้าเป็น c# จะดีมากคร่า ขอบคุณน๊ค๊ จะลองแปลงดู
โค้ดด้านบน อธิบายเปงภาษาไทยได้หรือป่าว
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-19 09:52:14 By : ++++
 


 

No. 4

Guest


VB == C# Line By Line
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-19 09:52:35 By : ผ่านมา
 


 

No. 5

Guest


Quote:
โค้ดด้านบน อธิบายเปงภาษาไทยได้หรือป่าว


ภาษา???: เปง
ภาษาไทย: เป็น

ภาษา??? : ป่าว
ภาษาไทย : ปล่าว
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-19 09:56:31 By : ผ่านมา
 


 

No. 6

Guest


อันนี้เป็นคนไทยแต่ไปทำงานอยู่ที่ อเมริกา เขาพึ่งโพสต์ 2013-09-18 23.08 +7 ก็ประมาณ 10.00 ในเมืองไทย
http://www.songkwae.com/foxboard/display_topic_threads.asp?ForumID=3&TopicID=4214&PagePosition=1

ผมคิดว่าเขา (คุณ Joe) คือ ความรู้สึก (ความรู้) อยู่เหนือภาษา


Code
Anyone who use VFP8 and above. Try to Register this web service and you can create this one out easily. 1) Open Task Pane and go to XML Web Service from the menu bar. If you can not see, just click >> and you will see it. 2) Click on Register an XML Web Service link and fill the popup box with "http://www.deeptraining.com/webservices/weather.asmx?WSDL" without quote and then click Register and then Done buttons 3) You will see "Explore an XML Web Service" bar than will show option of "Weather". 4) You will see the "Sample Code:", just copy and paste in the program window. 5) Add the "GetWeather", the one that display in "Method" box after you have registered the web service. 6) You will have the code similar to my code below. 7) I have added the lparameter so that I can call and get the return back and save the prg as WS_GetWeather.prg. For Example: lcReturn = WS_GetWeather('Seattle') && This service only allow for US city. *** It will return 'rain' LPARAMETERS tcCity AS STRING LOCAL loWeather AS "XML Web Service" * LOCAL loWeather AS "MSSOAP.SoapClient30" * Do not remove or alter following line. It is used to support IntelliSense for your XML Web service. *__VFPWSDef__: loWeather = http://www.deeptraining.com/webservices/weather.asmx?WSDL , Weather , WeatherSoap LOCAL loException, lcErrorMsg, loWSHandler TRY loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx") loWeather = loWSHandler.SetupClient("http://www.deeptraining.com/webservices/weather.asmx?WSDL", "Weather", "WeatherSoap") * Call your XML Web service here. ex: leResult = loWeather.SomeMethod() lcResponse = loWeather.GetWeather(tcCity) CATCH TO loException lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message DO CASE CASE VARTYPE(loWeather)#"O" * Handle SOAP error connecting to web service CASE !EMPTY(loWeather.FaultCode) * Handle SOAP error calling method lcErrorMsg=lcErrorMsg+CHR(13)+loWeather.Detail OTHERWISE * Handle other error ENDCASE * Use for debugging purposes MESSAGEBOX(lcErrorMsg) FINALLY ENDTRY RETURN lcResponse In wsdl file: - <wsdl:types> - <s:schema elementFormDefault="qualified" targetNamespace="http://litwinconsulting.com/webservices/"> - <s:element name="GetWeather"> <-- This one is the available service - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" /> <-- This is what to pass and what is the type. </s:sequence> </s:complexType> </s:element> - <s:element name="GetWeatherResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="GetWeatherResult" type="s:string" /> <-- This is returned value and what is the type. </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> - <wsdl:service name="Weather"> <-- This is the service name. (2nd parameter in loWSHandler.SetupClient) <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Provides weather forcasts for U.S. cities</wsdl:documentation> - <wsdl:port name="WeatherSoap" binding="tns:WeatherSoap"> <-- This is the Port Name. (3rd parameter in loWSHandler.SetupClient) <soap:address location="http://www.deeptraining.com/webservices/weather.asmx" /> <-- This is the URI. (1st parameter in loWSHandler.SetupClient) </wsdl:port> - <wsdl:port name="WeatherSoap12" binding="tns:WeatherSoap12"> <soap12:address location="http://www.deeptraining.com/webservices/weather.asmx" /> </wsdl:port> </wsdl:service> That is the way we consume Web Service from the other. We can Create our own web service and provide service to the other as well. ------------- Everything is possible. It depends on how we treat them. Live with them and learn from them to gain benefit from them.

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-19 10:15:37 By : ผ่านมา
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : .net ช่วยแนะนำการแสดงรูปจาก mysql ลง picturebox หน่อยคร่า c#
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่