现在.NET做C/S架构最佳的选择是什么?还是SOCKET?

codenamea 2014-06-02 03:19:31
有一段时间没有做.NET的开发了,最近有项目可能还是.NET最合适。于是想要问问。

现在.NET做C/S架构最佳的选择是什么? 还是SOCKET?
我做.NET的那时候还是2.0. 不知道现在4.5有没有退出什么更好的技术方案?


我的需求大概是这样。
因为有一台远程的服务器上一个SQL 2008的数据库,因为权限的问题,它不允许外部远程通过互联网来访问。
所以我想做一个小的服务器端程序装在这个SQL2008的服务器上,查询数据,并且把数据传输给我的客户端应用程序。

这个服务器端的程序可以简单到接受客户端发来的SQL并把执行结果返回回去就可以了。

有什么好的解决方案么?
...全文
734 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
showjim 2014-06-04
  • 打赏
  • 举报
回复
上面的格式错误,修改一下
        //[fastCSharp.setup.cSharp.serialize]
        public partial class dataTable
        {
            private dataArray data;
            private string name;
            private string[] columnNames;
            private byte[] columnIndexs;
            private byte[] dbNull;
            private int rowCount;
            public static dataTable From(DataTable table)
            {
                if (table == null) return null;
                dataTable value = new dataTable();
                if ((value.rowCount = table.Rows.Count) != 0)
                {
                    using (dataBuilder builder = new dataBuilder())
                    {
                        value.from(table, builder);
                        value.data = builder.Get();
                    }
                }
                return value;
            }
            internal static dataTable From(DataTable table, dataBuilder builder)
            {
                dataTable value = new dataTable();
                if ((value.rowCount = table.Rows.Count) != 0) value.from(table, builder);
                value.name = table.TableName;
                return value;
            }
            private unsafe void from(DataTable table, dataBuilder builder)
            {
                int index = 0;
                columnNames = new string[table.Columns.Count];
                fixed (byte* columnFixed = columnIndexs = new byte[columnNames.Length])
                {
                    byte* columnIndex = columnFixed;
                    foreach (DataColumn column in table.Columns)
                    {
                        *columnIndex++ = typeIndexs.Get(column.DataType, 255);
                        columnNames[index++] = column.ColumnName;
                    }
                    fixed (byte* nullFixed = dbNull = new byte[(columnNames.Length * rowCount + 7) >> 3])
                    {
                        fixedMap nullMap = new fixedMap(nullFixed);
                        index = 0;
                        foreach (DataRow row in table.Rows)
                        {
                            columnIndex = columnFixed;
                            foreach (object value in row.ItemArray)
                            {
                                if (value == DBNull.Value) nullMap.Set(index);
                                else builder.Append(value, *columnIndex);
                                ++index;
                                ++columnIndex;
                            }
                        }
                    }
                }
            }
            public unsafe static DataTable Get(dataTable value)
            {
                if (value == null) return null;
                DataTable table = new DataTable(value.name);
                if (value.rowCount != 0)
                {
                    fixed (byte* dataFixed = value.data.Data)
                    {
                        objectBuilder builder = new objectBuilder(dataFixed, value.data.Strings);
                        value.get(table, builder);
                    }
                }
                return table;
            }
            internal DataTable Get(objectBuilder builder)
            {
                DataTable table = new DataTable(name);
                if (rowCount != 0) get(table, builder);
                return table;
            }
            private unsafe void get(DataTable table, objectBuilder builder)
            {
                int index = 0;
                DataColumn[] columns = new DataColumn[columnNames.Length];
                fixed (byte* columnFixed = columnIndexs)
                {
                    byte* columnIndex = columnFixed;
                    foreach (string columnName in columnNames)
                    {
                        columns[index++] = new DataColumn(columnName, *columnIndex < types.Length ? types[*columnIndex] : typeof(object));
                        ++columnIndex;
                    }
                    table.Columns.AddRange(columns);
                    fixed (byte* nullFixed = dbNull)
                    {
                        fixedMap nullMap = new fixedMap(nullFixed);
                        for (index = 0; rowCount != 0; --rowCount)
                        {
                            object[] values = new object[columnNames.Length];
                            columnIndex = columnFixed;
                            for (int valueIndex = 0; valueIndex != columnNames.Length; ++valueIndex)
                            {
                                values[valueIndex] = nullMap.Get(index++) ? DBNull.Value : builder.Get(*columnIndex);
                                ++columnIndex;
                            }
                            DataRow row = table.NewRow();
                            row.ItemArray = values;
                            table.Rows.Add(row);
                        }
                    }
                }
            }
        }
        private dataArray data;
        private string name;
        private dataTable[] tables;
        private void from(DataSet set)
        {
            if (set.Tables.Count != 0)
            {
                using (dataBuilder builder = new dataBuilder())
                {
                    tables = set.Tables.toGeneric<DataTable>().getArray(table => dataTable.From(table, builder));
                    data = builder.Get();
                }
            }
            name = set.DataSetName;
        }
        public static dataSet From(DataSet set)
        {
            if (set == null) return null;
            dataSet value = new dataSet();
            value.from(set);
            return value;
        }
        private unsafe void set(DataSet set)
        {
            if (tables.length() != 0)
            {
                fixed (byte* dataFixed = data.Data)
                {
                    objectBuilder builder = new objectBuilder(dataFixed, data.Strings);
                    foreach (dataTable table in tables) set.Tables.Add(table.Get(builder));
                }
            }
        }
        public unsafe static DataSet Get(dataSet value)
        {
            if (value == null) return null;
            DataSet set = new DataSet(value.name);
            value.set(set);
            return set;
        }
        private static readonly Type[] types;
        private static readonly staticDictionary<hashCode<Type>, byte> typeIndexs;
        static dataSet()
        {
            int index = 0;
            types = new Type[29];
            keyValue<hashCode<Type>, byte>[] typeArray = new keyValue<hashCode<Type>, byte>[types.Length];
            typeArray[index].Set(types[index] = typeof(int), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(int?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(string), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(DateTime), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(DateTime?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(double), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(double?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(float), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(float?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(decimal), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(decimal?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(Guid), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(Guid?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(bool), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(bool?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(byte), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(byte?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(sbyte), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(sbyte?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(short), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(short?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ushort), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ushort?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(uint), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(uint?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(long), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(long?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ulong), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ulong?), (byte)index);
            typeIndexs = new staticDictionary<hashCode<Type>, byte>(typeArray);
        }
    }
}
showjim 2014-06-04
  • 打赏
  • 举报
回复
继续
        //[fastCSharp.setup.cSharp.serialize]
        public partial class dataTable
        {
            private dataArray data;
            private string name;
            private string[] columnNames;
            private byte[] columnIndexs;
            private byte[] dbNull;
            private int rowCount;
            public static dataTable From(DataTable table)
            {
                if (table == null) return null;
                dataTable value = new dataTable();
                if ((value.rowCount = table.Rows.Count) != 0)
                {
                    using (dataBuilder builder = new dataBuilder())
                    {
                        value.from(table, builder);
                        value.data = builder.Get();
                    }
                }
                return value;
            }
            internal static dataTable From(DataTable table, dataBuilder builder)
            {
                dataTable value = new dataTable();
                if ((value.rowCount = table.Rows.Count) != 0) value.from(table, builder);
                value.name = table.TableName;
                return value;
            }
            private unsafe void from(DataTable table, dataBuilder builder)
            {
                int index = 0;
                columnNames = new string[table.Columns.Count];
                fixed (byte* columnFixed = columnIndexs = new byte[columnNames.Length])
                {
                    byte* columnIndex = columnFixed;
                    foreach (DataColumn column in table.Columns)
                    {
                        *columnIndex++ = typeIndexs.Get(column.DataType, 255);
                        columnNames[index++] = column.ColumnName;
                    }
                    fixed (byte* nullFixed = dbNull = new byte[(columnNames.Length * rowCount + 7) >> 3])
                    {
                        fixedMap nullMap = new fixedMap(nullFixed);
                        index = 0;
                        foreach (DataRow row in table.Rows)
                        {
                            columnIndex = columnFixed;
                            foreach (object value in row.ItemArray)
                            {
                                if (value == DBNull.Value) nullMap.Set(index);
                                else builder.Append(value, *columnIndex);
                                ++index;
                                ++columnIndex;
                            }
                        }
                    }
                }
            }
            public unsafe static DataTable Get(dataTable value)
            {
                if (value == null) return null;
                DataTable table = new DataTable(value.name);
                if (value.rowCount != 0)
                {
                    fixed (byte* dataFixed = value.data.Data)
                    {
                        objectBuilder builder = new objectBuilder(dataFixed, value.data.Strings);
                        value.get(table, builder);
                    }
                }
                return table;
            }
            internal DataTable Get(objectBuilder builder)
            {
                DataTable table = new DataTable(name);
                if (rowCount != 0) get(table, builder);
                return table;
            }
            private unsafe void get(DataTable table, objectBuilder builder)
            {
                int index = 0;
                DataColumn[] columns = new DataColumn[columnNames.Length];
                fixed (byte* columnFixed = columnIndexs)
                {
                    byte* columnIndex = columnFixed;
                    foreach (string columnName in columnNames)
                    {
                        columns[index++] = new DataColumn(columnName, *columnIndex < types.Length ? types[*columnIndex] : typeof(object));
                        ++columnIndex;
                    }
                    table.Columns.AddRange(columns);
                    fixed (byte* nullFixed = dbNull)
                    {
                        fixedMap nullMap = new fixedMap(nullFixed);
                        for (index = 0; rowCount != 0; --rowCount)
                        {
                            object[] values = new object[columnNames.Length];
                            columnIndex = columnFixed;
                            for (int valueIndex = 0; valueIndex != columnNames.Length; ++valueIndex)
                            {
                                values[valueIndex] = nullMap.Get(index++) ? DBNull.Value : builder.Get(*columnIndex);
                                ++columnIndex;
                            }
                            DataRow row = table.NewRow();
                            row.ItemArray = values;
                            table.Rows.Add(row);
                        }
                    }
                }
            }
        }
        private dataArray data;
        private string name;
        private dataTable[] tables;
        private void from(DataSet set)
        {
            if (set.Tables.Count != 0)
            {
                using (dataBuilder builder = new dataBuilder())
                {
                    tables = set.Tables.toGeneric<DataTable>().getArray(table => dataTable.From(table, builder));
                    data = builder.Get();
                }
            }
            name = set.DataSetName;
        }
        public static dataSet From(DataSet set)
        {
            if (set == null) return null;
            dataSet value = new dataSet();
            value.from(set);
            return value;
        }
        private unsafe void set(DataSet set)
        {
            if (tables.length() != 0)
            {
                fixed (byte* dataFixed = data.Data)
                {
                    objectBuilder builder = new objectBuilder(dataFixed, data.Strings);
                    foreach (dataTable table in tables) set.Tables.Add(table.Get(builder));
                }
            }
        }
        public unsafe static DataSet Get(dataSet value)
        {
            if (value == null) return null;
            DataSet set = new DataSet(value.name);
            value.set(set);
            return set;
        }
        private static readonly Type[] types;
        private static readonly staticDictionary<hashCode<Type>, byte> typeIndexs;
        static dataSet()
        {
            int index = 0;
            types = new Type[29];
            keyValue<hashCode<Type>, byte>[] typeArray = new keyValue<hashCode<Type>, byte>[types.Length];
            typeArray[index].Set(types[index] = typeof(int), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(int?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(string), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(DateTime), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(DateTime?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(double), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(double?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(float), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(float?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(decimal), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(decimal?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(Guid), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(Guid?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(bool), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(bool?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(byte), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(byte?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(sbyte), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(sbyte?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(short), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(short?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ushort), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ushort?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(uint), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(uint?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(long), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(long?), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ulong), (byte)index);
            ++index;
            typeArray[index].Set(types[index] = typeof(ulong?), (byte)index);
            typeIndexs = new staticDictionary<hashCode<Type>, byte>(typeArray);
        }
    }
}
showjim 2014-06-04
  • 打赏
  • 举报
回复
试试fastCSharp的TCP调用,不能直接使用DataSet/DataTable作为参数,你可以使用下面这个类相互转换
using System;
using System.Data;
using fastCSharp;

namespace fastCSharp.sql
{
    //[fastCSharp.setup.cSharp.serialize]
    public partial class dataSet
    {
        internal class dataBuilder : IDisposable
        {
            private unmanagedStream stream = new unmanagedStream();
            private list<string> strings = new list<string>();
            public void Append(object value, byte typeIndex)
            {
                switch (typeIndex)
                {
                    case 0:
                        stream.Write((int)value);
                        break;
                    case 1:
                        stream.Write((int)(int?)value);
                        break;
                    case 2:
                        strings.Add((string)value);
                        break;
                    case 3:
                        stream.Write(((DateTime)value).Ticks);
                        break;
                    case 4:
                        stream.Write(((DateTime)(DateTime?)value).Ticks);
                        break;
                    case 5:
                        stream.Write((double)value);
                        break;
                    case 6:
                        stream.Write((double)(double?)value);
                        break;
                    case 7:
                        stream.Write((float)value);
                        break;
                    case 8:
                        stream.Write((float)(float?)value);
                        break;
                    case 9:
                        stream.Write((decimal)value);
                        break;
                    case 10:
                        stream.Write((decimal)(decimal?)value);
                        break;
                    case 11:
                        stream.Write((Guid)value);
                        break;
                    case 12:
                        stream.Write((Guid)(Guid?)value);
                        break;
                    case 13:
                        stream.Write((bool)value ? (byte)1 : (byte)0);
                        break;
                    case 14:
                        stream.Write((bool)(bool?)value ? (byte)1 : (byte)0);
                        break;
                    case 15:
                        stream.Write((byte)value);
                        break;
                    case 16:
                        stream.Write((byte)(byte?)value);
                        break;
                    case 17:
                        stream.Write((sbyte)value);
                        break;
                    case 18:
                        stream.Write((sbyte)(sbyte?)value);
                        break;
                    case 19:
                        stream.Write((short)value);
                        break;
                    case 20:
                        stream.Write((short)(short?)value);
                        break;
                    case 21:
                        stream.Write((ushort)value);
                        break;
                    case 22:
                        stream.Write((ushort)(ushort?)value);
                        break;
                    case 23:
                        stream.Write((uint)value);
                        break;
                    case 24:
                        stream.Write((uint)(uint?)value);
                        break;
                    case 25:
                        stream.Write((long)value);
                        break;
                    case 26:
                        stream.Write((long)(long?)value);
                        break;
                    case 27:
                        stream.Write((ulong)value);
                        break;
                    case 28:
                        stream.Write((ulong)(ulong?)value);
                        break;
                }
            }
            public dataArray Get()
            {
                dataArray value = new dataArray();
                value.Data = stream.GetArray();
                value.Strings = strings.ToArray();
                return value;
            }
            public void Dispose()
            {
                pub.Dispose(ref stream);
            }
        }
        internal unsafe class objectBuilder
        {
            private byte* data;
            private string[] strings;
            private int stringIndex;
            public objectBuilder(byte* dataFixed, string[] strings)
            {
                data = dataFixed;
                this.strings = strings;
            }
            public object Get(byte typeIndex)
            {
                object value;
                switch (typeIndex)
                {
                    case 0:
                        value = *(int*)data;
                        data += sizeof(int);
                        return value;
                    case 1:
                        value = (int?)*(int*)data;
                        data += sizeof(int);
                        return value;
                    case 2:
                        return strings[stringIndex++];
                    case 3:
                        value = new DateTime(*(long*)data);
                        data += sizeof(long);
                        return value;
                    case 4:
                        value = (DateTime?)new DateTime(*(long*)data);
                        data += sizeof(long);
                        return value;
                    case 5:
                        value = *(double*)data;
                        data += sizeof(double);
                        return value;
                    case 6:
                        value = (double?)*(double*)data;
                        data += sizeof(double);
                        return value;
                    case 7:
                        value = *(float*)data;
                        data += sizeof(float);
                        return value;
                    case 8:
                        value = (float?)*(float*)data;
                        data += sizeof(float);
                        return value;
                    case 9:
                        value = *(decimal*)data;
                        data += sizeof(decimal);
                        return value;
                    case 10:
                        value = (decimal?)*(decimal*)data;
                        data += sizeof(decimal);
                        return value;
                    case 11:
                        value = *(Guid*)data;
                        data += sizeof(Guid);
                        return value;
                    case 12:
                        value = (Guid?)*(Guid*)data;
                        data += sizeof(Guid);
                        return value;
                    case 13:
                        value = *(byte*)data != 0;
                        ++data;
                        return value;
                    case 14:
                        value = (bool?)(*(byte*)data != 0);
                        ++data;
                        return value;
                    case 15:
                        value = *(byte*)data;
                        ++data;
                        return value;
                    case 16:
                        value = (byte?)*(byte*)data;
                        ++data;
                        return value;
                    case 17:
                        value = *(sbyte*)data;
                        ++data;
                        return value;
                    case 18:
                        value = (sbyte?)*(sbyte*)data;
                        ++data;
                        return value;
                    case 19:
                        value = *(short*)data;
                        data += sizeof(short);
                        return value;
                    case 20:
                        value = (short?)*(short*)data;
                        data += sizeof(short);
                        return value;
                    case 21:
                        value = *(ushort*)data;
                        data += sizeof(ushort);
                        return value;
                    case 22:
                        value = (ushort?)*(ushort*)data;
                        data += sizeof(ushort);
                        return value;
                    case 23:
                        value = *(uint*)data;
                        data += sizeof(uint);
                        return value;
                    case 24:
                        value = (uint?)*(uint*)data;
                        data += sizeof(uint);
                        return value;
                    case 25:
                        value = *(long*)data;
                        data += sizeof(long);
                        return value;
                    case 26:
                        value = (long?)*(long*)data;
                        data += sizeof(long);
                        return value;
                    case 27:
                        value = *(ulong*)data;
                        data += sizeof(ulong);
                        return value;
                    case 28:
                        value = (ulong?)*(ulong*)data;
                        data += sizeof(ulong);
                        return value;
                }
                return null;
            }
        }
        //[fastCSharp.setup.cSharp.serialize]
        internal partial class dataArray
        {
            public byte[] Data;
            public string[] Strings;
        }
未完待续
by_封爱 版主 2014-06-03
  • 打赏
  • 举报
回复
首先我想说 cs架构 跟socket没一毛钱关系,,,请别把他们扯到一起... 然后说你的问题..无非就是CS程序不允许通过远程访问数据库 想做个服务而已.. 那就webservice没什么好说的...也就是说 把操作数据库的公共方法public而已.. 最多就是几个方法 1查询返回 2执行SQL 3执行proc 而已.. 什么wpf wcf 花里花俏我大材小用.我只能呵呵..
bdmh 2014-06-03
  • 打赏
  • 举报
回复
你的问题用webservice,remoting,wcf都可以,非即时信息可以不考虑socket
mwp 2014-06-03
  • 打赏
  • 举报
回复
socket虽然强大,但是太低级了,有个开源的XML RPC的库楼主可以试试,接近webservice,但是比webservice 部署要简单的多
ww19881214 2014-06-03
  • 打赏
  • 举报
回复
帮你顶一下吧,.net入门
M依然 2014-06-03
  • 打赏
  • 举报
回复
建议还是Web Service 。socket是即时通讯的手段。用不用在于你。 控制访问写Web Service就行了
smthgdin_020 2014-06-03
  • 打赏
  • 举报
回复
Web Service和WCF都行。
tcmakebest 2014-06-03
  • 打赏
  • 举报
回复
webservice,我的项目都是靠它,也许WCF更好,但还没有尝试。
CGabriel 2014-06-03
  • 打赏
  • 举报
回复
RESTFul API http://baike.baidu.com/link?url=RimN6XT6vxZ_iXJVM9ts8ZDysIcjudwuBGKJwDgRsrQRC2QPomgFgU2ovtoUhXoaiO6hEzLWze7XKe8ok0i8ca 看到那笨重的 Webservice, wcf 就觉得头痛。。
liuruitao647 2014-06-03
  • 打赏
  • 举报
回复
引用 9 楼 bdmh 的回复:
你的问题用webservice,remoting,wcf都可以,非即时信息可以不考虑socket
此处有字,呵呵
exception92 2014-06-03
  • 打赏
  • 举报
回复
webservice就可以。用什么wcf。。
约翰德鲁伊 2014-06-03
  • 打赏
  • 举报
回复
引用 10 楼 diaodiaop 的回复:
首先我想说 cs架构 跟socket没一毛钱关系,,,请别把他们扯到一起... 然后说你的问题..无非就是CS程序不允许通过远程访问数据库 想做个服务而已.. 那就webservice没什么好说的...也就是说 把操作数据库的公共方法public而已.. 最多就是几个方法 1查询返回 2执行SQL 3执行proc 而已.. 什么wpf wcf 花里花俏我大材小用.我只能呵呵..
呵呵。
  • 打赏
  • 举报
回复
TcpListner --> TcpListener
  • 打赏
  • 举报
回复
我们在服务器开发时不使用低级的Socket类(那个东西只是为了兼容linux下的规范所用的而已),我们使用TcpListner和TcpClient类(因为这支持IOCP),并且我们使用HttpListner类等等。
Ptrtoptr 2014-06-02
  • 打赏
  • 举报
回复
wcf+wpf+ef
足球中国 2014-06-02
  • 打赏
  • 举报
回复
webservice,wcf,比较常用的。 http://bbs.csdn.net/topics/390776749 我的这个是也可以做到兼容动软代码生成器。内部使用tcp。 不过我这个收费小项目一般也用不到。
hard_learner 2014-06-02
  • 打赏
  • 举报
回复
现在一般是用WCF实现客户端的功能了
rtdb 2014-06-02
  • 打赏
  • 举报
回复
用socket太麻烦了,wcf 更简单
加载更多回复(1)

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧