hi, I want to import fixed line text into database like excel import wizard. does anyone know how to make this view using c#.net? http://i999.photobucket.com/albums/af118/eyeshield21\_85/excellfixedline.png regards, andy
eyeshield21
Posts
-
excel import wizard (fixed line) -
detect the connection has been disconnect in tcpclienthi, the problem is solved, I use Ping to detect the client is disconnected regards, andy
-
detect the connection has been disconnect in tcpclienthi ahsan, I have tried to sent the packet with interval 1 second each packet, but it needs 35 packet to detect that the client is disconnected. //code while (isPlugin) { Thread.Sleep(1000); try { if (isPlugin == true) { byte[] data = new byte[1024]; data = Encoding.ASCII.GetBytes("IsPlugin"); try { Log.Write("write Plugin"); sessionNetwork.Write(data, 0, 8); } catch (Exception ex) { Log.Write("Plugin is remove error : {0}", ex.Message); isPlugin = false; break; } } else { isPlugin = false; break; } } catch { Log.Write("Plugin is remove"); isPlugin = false; break; } } if (isPlugin == false) { Log.Write("Plugin is remove DisconnectOntraceSessionThread"); ClientDisconnect; }
-
detect the connection has been disconnect in tcpclienthi, I use tcpclient to build client server application how to detect that the LAN is disconnected (unpluged) when we call networkstream.read()? //code while(true) { data = new byte[1024]; recv = ns.Read(data, 0, data.Length); // I unpluged the LAN but it still reading process if (recv == 0) break; Console.WriteLine( Encoding.ASCII.GetString(data, 0, recv)); ns.Write(data, 0, recv); } regards, andy
-
C#.net DisplayI develop the application using C#.net in windows xp (english version) when I run the application the display (image) still good but when I deploy to another computer which using windows xp (chinese version) the display (image) become not good does anyone knows why it happen and how to solve it? regards, andy
-
sizeof(struct) in C#.netcan I use this: MT_EVENT evt = new MT_EVENT(); uint length= (uint) Marshal.SizeOf(evt);
-
convert C struct into C#.netthanks alot all...
-
sizeof(struct) in C#.nethi, I want to ask how to get size of struct that I made? ex: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] public struct MT_EVENT { public Int64 TimeStamp; // In FILETIME format //public LARGE_INTEGER TimeStamp; // In FILETIME format public uint UserStatus; // Not used by API public uint EventCode; // Event Code public uint SubReason; // Event sub-reason public uint XtraInfo; // Extra information, e.g. termination public uint FuncCode; // Function active when this event occurred public uint Board; // Board ID public uint Channel; // Global Channel ID (GCI) public IntPtr ptrBuffer; // Related play/record buffer pointer public uint DataLength; // Byte length of data accessed (played/recorded) public IntPtr ptrXtraBuffer; // Pointer to xtra buffer public uint XtraBufferLength; // Length of buffer pointed by ptrXtraBuffer public uint XtraDataLength; // Length of data in buffer pointed by ptrXtraBuffer public uint EventFlag; // Falgs of the following: // bit 0x00000001: 1 - Appl created the event // 0 - NTi DLL created the event // bit 0x00000002: 1 - Appl allocated ptrtraBuffer // 0 - NTi DLL allocated ptrXtraBuffer }
-
convert C struct into C#.nethi, I want to ask how to convert this C struct into C#.net typedef struct _MT_EVENT { #if _WIN32 LARGE_INTEGER TimeStamp; // In FILETIME format #elif LINUX struct timeval TimeStamp; // In gettimeofday() format #endif ULONG UserStatus; // Not used by API ULONG EventCode; // Event Code ULONG SubReason; // Event sub-reason ULONG XtraInfo; // Extra information, e.g. termination ULONG FuncCode; // Function active when this event occurred USHORT Board; // Board ID USHORT Channel; // Global Channel ID (GCI) PVOID ptrBuffer; // Related play/record buffer pointer ULONG DataLength; // Byte length of data accessed (played/recorded) PVOID ptrXtraBuffer; // Pointer to xtra buffer ULONG XtraBufferLength; // Length of buffer pointed by ptrXtraBuffer ULONG XtraDataLength; // Length of data in buffer pointed by ptrXtraBuffer ULONG EventFlag; // Falgs of the following: // bit 0x00000001: 1 - Appl created the event // 0 - NTi DLL created the event // bit 0x00000002: 1 - Appl allocated ptrtraBuffer // 0 - NTi DLL allocated ptrXtraBuffer } MT_EVENT, *PMT_EVENT;