 |
|
สอบถามเรื่องการเขียนโปรแกรม remote desktop ครับ... |
|
 |
|
|
 |
 |
|
ต้องทำเป็น os แต่ละอันนะ
ถ้าจะ remote ไป windows ก็ต้องซื้อ license จาก ms ด้วย
ถึงจะทำได้ เพราะเคยอ่าน description ของ app แล้วไปเจอเหตุผลว่าทำไมไม่ทำ windows
ส่วนโค้ด ไม่รู้อ่ะ
|
 |
 |
 |
 |
Date :
2016-05-25 09:17:34 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เหมือน team หรือ vnc ประมาณนั้นรึครับ
รึแค่ทำผ่าน แลน ครับ
อันนี้ไม่เคยทำนะครับแต่หากเรามองให้เหมือนกับ team หรือ vnc
จะสังเกตว่า มีเครื่อง แม่กับเครื่องลูก ซึ่งทั้ง 2 ต้องมี โปรแกรม ตอบสนองซึ่งกันและกัน
โดยเครื่องลูกควบคุม control ต่างๆในเครื่องลูก แล้ว รับ-ส่งค่า จากเครื่องแม่
ไม่ใช่ว่าเครื่องแม่ควบคุม control ต่างๆในเครื่องลูก
อันนี้คิดเองครับ เพราะการรับ-ส่งจากเครื่องลูกน่าจะง่ายและเร็วกว่า ควบคุมจากเครื่องแม่ แถมใช้งาน โปแกรมทุกตัวในเครื่องลูกได้เต็ม 100 ด้วย ส่วนที่เรียกว่าควบคุมจากเครื่องแม่ที่ผมเห็นก็คงมีแค่ Scan กับ เครื่องปริ๊น เท่านั้นเอง(ถ้าความคิดผมถูกต้องนะครับ) เวลาเรา Add มันถึงให้มี driver พ่วงมาเครื่องแม่ด้วยไงละครับ
จากที่มอง
1. หน้าจอ สามารถ รับ-ส่ง ข้อมูลได้
2. เมาส์ คีบอร์ด สามารถ รับ-ส่ง ข้อมูลได้
สรุป ถ้าเราหาวิธี ใช้งาน control ต่างๆในเครื่องเราได้ ก็น่าจะ ควบคุมเครื่องอื่นได้โดยปริยายครับ
|
 |
 |
 |
 |
Date :
2016-05-25 11:41:29 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
remote desktop ไม่เหมือน team viewer หรือ vnc นะ
เป็นการเข้ามาใช้ด้วย account ของเครื่องผ่าน network ได้เลย
ถ้าเป็น windows ที่ไม่ใช่ server นี่ ถ้ามีคน remote เข้ามา
มันจะเตะคนใช้อยู่ออกเลย ถึงแม้ว่าจะนั่งอยู่กับเครื่องก็ตาม
ยกเว้นพวก server สามารถ ใช้งานได้พร้อมกันหลาย session ได้
|
 |
 |
 |
 |
Date :
2016-05-25 14:05:43 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โทษทีครับ
แสดงว่าผมคิดผิดจริงๆ( ปล่อยไก่ตัวบะเอ๊บ 5555)
|
 |
 |
 |
 |
Date :
2016-05-25 14:11:11 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จากที่อ่านโจทย์เค้าถามอยากเขียนโปรแกรม remote นะครับ ส่วนคำว่า remote desktop น่าจะไปเหมือนกับโปรแกรมฟรี remote ของ windows ที่มีมาให้อยู่แล้ว
คำถาม
- เขียนไปทำไมหรือ? โปรเจ็คจบ, งานส่วนตัว, งานบริษัท หรืออะไร งง มีของฟรีให้ใช้เยอะแยะ ไมไม่ใช้ ยิ่งตอนนี้ ฟรีเพียวๆ ของ google แจ่มใช้ได้เลย ไม่มีแค่ transfer file แค่นั้น (ก็ใช้วิธีอื่นส่งไฟล์กันเอา มีวิธีเยอะแยะ) คือสงสัยส่วนตัว เพราะไม่เข้าใจว่าจะเขียนทำไม
คำตอบ
- ลองเข้าไปหาโปรเจ็คต้นแบบของโปรแกรมประเภท remote desktop ทั้งหลายแหล่เอาได้ใน sourceforge.net ครับ ของ vnc ก็มี
download code มาทำความเข้าใจแล้วเอามาประยุกต์ได้ (เพียงแต่เวอร์ชั่นอาจจะเก่าไปหน่อย ก็ลองใช้ดูเป็นแนวทางครับ) เข้าใจว่าของ
team version แรกๆ ก็มีนะสมัยที่ยังให้ใช้ฟรีๆอยู่
ตัวนี้เป็นของ google ฟรีไร้เงื่อนไข (แค่ไม่มี function file transfer) ลองไปศึกษาดูได้

ปล. ไว้ว่างๆ จะมาเขียนวิธีทำไว้ใช้ support ลูกค้าครับ  
|
 |
 |
 |
 |
Date :
2016-05-25 19:59:31 |
By :
salapao_codeman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ที่ผมเคยทำนะครับ หลังจากที่ Remote ไปได้แล้วนะครับ
C# : Console นะครับ ลองเอาไปประยุกต์ดู
Code (C#)
public static class User32
{
public const Int32 CURSOR_SHOWING = 0x00000001;
[StructLayout(LayoutKind.Sequential)]
public struct ICONINFO
{
public bool fIcon;
public Int32 xHotspot;
public Int32 yHotspot;
public IntPtr hbmMask;
public IntPtr hbmColor;
}
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public Int32 x;
public Int32 y;
}
[StructLayout(LayoutKind.Sequential)]
public struct CURSORINFO
{
public Int32 cbSize;
public Int32 flags;
public IntPtr hCursor;
public POINT ptScreenPos;
}
[DllImport("user32.dll")]
public static extern bool GetCursorInfo(out CURSORINFO pci);
[DllImport("user32.dll")]
public static extern IntPtr CopyIcon(IntPtr hIcon);
[DllImport("user32.dll")]
public static extern bool DrawIcon(IntPtr hdc, int x, int y, IntPtr hIcon);
[DllImport("user32.dll")]
public static extern bool GetIconInfo(IntPtr hIcon, out ICONINFO piconinfo);
}
static void Main(string[] args)
{
Socket socket;
string _ip = File.ReadAllText("getIP.txt");
Console.WriteLine(_ip);
using (socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
{
//socket.Connect(new IPEndPoint(IPAddress.Loopback, 23456));
socket.Connect(_ip,9050);
while (true)
{
var bounds = Screen.PrimaryScreen.Bounds;
var bitmap = new Bitmap(bounds.Width, bounds.Height);
try
{
while (true)
{
using (var graphics = Graphics.FromImage(bitmap))
{
graphics.CopyFromScreen(bounds.X, 0, bounds.Y, 0, bounds.Size);
////////////////////////////////////////
User32.CURSORINFO cursorInfo;
cursorInfo.cbSize = Marshal.SizeOf(typeof(User32.CURSORINFO));
if (User32.GetCursorInfo(out cursorInfo))
{
// if the cursor is showing draw it on the screen shot
if (cursorInfo.flags == User32.CURSOR_SHOWING)
{
// we need to get hotspot so we can draw the cursor in the correct position
var iconPointer = User32.CopyIcon(cursorInfo.hCursor);
User32.ICONINFO iconInfo;
int iconX, iconY;
if (User32.GetIconInfo(iconPointer, out iconInfo))
{
// calculate the correct position of the cursor
iconX = cursorInfo.ptScreenPos.x - ((int)iconInfo.xHotspot);
iconY = cursorInfo.ptScreenPos.y - ((int)iconInfo.yHotspot);
// draw the cursor icon on top of the captured screen image
User32.DrawIcon(graphics.GetHdc(), iconX, iconY, cursorInfo.hCursor);
// release the handle created by call to g.GetHdc()
graphics.ReleaseHdc();
}
}
}
////////////////////////////////////////
}
byte[] imageData;
using (var stream = new MemoryStream())
{
bitmap.Save(stream, ImageFormat.Png);
imageData = stream.ToArray();
}
var lengthData = BitConverter.GetBytes(imageData.Length);
if (socket.Send(lengthData) < lengthData.Length) break;
if (socket.Send(imageData) < imageData.Length) break;
Thread.Sleep(10);
}
}
catch(Exception)
{
//socket.Shutdown(SocketShutdown.Both);
// socket.Close();
break;
}
}
}
Application.Exit();
}
|
 |
 |
 |
 |
Date :
2016-05-25 20:27:01 |
By :
bigsuntat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอบคำถามท่านที่ถามว่าเขียนไปทำไม คือ ที่เขียนเพราะอยากรู้ อยากทำ อยากเป็นครับ เพราะไม่รู้หาดูแล้วลองทำแล้วแต่ยังไม่ได้จึงมาขอแนวทางครับ
|
 |
 |
 |
 |
Date :
2016-05-26 11:44:50 |
By :
punmontha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอเกาะไปด้วยคนครับ
|
 |
 |
 |
 |
Date :
2016-05-31 21:27:25 |
By :
deksoke |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|