Click here to Skip to main content
15,887,355 members
Home / Discussions / C#
   

C#

 
GeneralRe: Displaying a grid of mixed controls from tabular data Pin Pin
Richard MacCutchan7-Jun-18 3:52
mveRichard MacCutchan7-Jun-18 3:52 
GeneralRe: Displaying a grid of mixed controls from tabular data Pin Pin
Leif Simon Goodwin7-Jun-18 21:34
Leif Simon Goodwin7-Jun-18 21:34 
QuestionC# COM dll with same name and same location to work for two projects/modules Pin
Member 117321396-Jun-18 21:31
Member 117321396-Jun-18 21:31 
QuestionRe: C# COM dll with same name and same location to work for two projects/modules Pin
Richard MacCutchan6-Jun-18 21:53
mveRichard MacCutchan6-Jun-18 21:53 
AnswerRe: C# COM dll with same name and same location to work for two projects/modules Pin
Member 117321396-Jun-18 22:57
Member 117321396-Jun-18 22:57 
GeneralRe: C# COM dll with same name and same location to work for two projects/modules Pin
Richard MacCutchan6-Jun-18 23:05
mveRichard MacCutchan6-Jun-18 23:05 
GeneralRe: C# COM dll with same name and same location to work for two projects/modules Pin
OriginalGriff6-Jun-18 23:19
mveOriginalGriff6-Jun-18 23:19 
Questioncant send file bigger that 1 megabit ( Server_client ) *(Thanks For helping fixed) Pin
Hussein Tb6-Jun-18 3:20
Hussein Tb6-Jun-18 3:20 
cant send file bigger that 1 megabit ( Server_client )

C#
        private byte[] GetFileInfo(string fname, string fext, long fsize)
        {
// i was not attention to this Code
// The problem was from here 1024 ,i changed it to 102400000 now correctly working thanks
            byte[] data = new byte[1024];//<--
            byte[] type = Encoding.UTF8.GetBytes("fff");

            byte[] ext = Encoding.UTF8.GetBytes(fext);
            byte[] extE = Encoding.UTF8.GetBytes(":");

            byte[] sizeS = Encoding.UTF8.GetBytes(fsize.ToString());
            byte[] sizeE = Encoding.UTF8.GetBytes("s");

            byte[] name = Encoding.UTF8.GetBytes(fname);
            byte[] nameE = Encoding.UTF8.GetBytes("?");

            Array.Copy(type, data, type.Length);
            Array.Copy(ext, 0, data, type.Length, ext.Length);
            Array.Copy(extE, 0, data, ext.Length + type.Length, extE.Length);
            Array.Copy(sizeS, 0, data, ext.Length + type.Length + extE.Length, sizeS.Length);
            Array.Copy(sizeE, 0, data, ext.Length + type.Length + extE.Length + sizeS.Length, sizeE.Length);
            Array.Copy(name, 0, data, ext.Length + type.Length + extE.Length + sizeS.Length + sizeE.Length, name.Length);
            Array.Copy(nameE, 0, data, ext.Length + type.Length + extE.Length + sizeS.Length + sizeE.Length + name.Length, nameE.Length);
            byte[] newdata = new byte[ext.Length + extE.Length + sizeS.Length + sizeE.Length + name.Length + nameE.Length + type.Length];
            Array.Copy(data, newdata, newdata.Length);
            return newdata;
        }
        private byte[] GetBinaryFile(string filename)
        {
            byte[] bytes;
            using (FileStream file = new FileStream(filename, FileMode.Open, FileAccess.Read))
            {
                bytes = new byte[file.Length];
                file.Read(bytes, 0, (int)file.Length);
            }
            return bytes;
        }
    }
}


modified 7-Jun-18 1:26am.

SuggestionRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Richard MacCutchan6-Jun-18 3:56
mveRichard MacCutchan6-Jun-18 3:56 
AnswerRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Gerry Schmitz6-Jun-18 7:08
mveGerry Schmitz6-Jun-18 7:08 
QuestionRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Eddy Vluggen6-Jun-18 11:21
professionalEddy Vluggen6-Jun-18 11:21 
AnswerRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Hussein Tb6-Jun-18 18:44
Hussein Tb6-Jun-18 18:44 
GeneralRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Hussein Tb6-Jun-18 18:55
Hussein Tb6-Jun-18 18:55 
QuestionRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Eddy Vluggen6-Jun-18 11:20
professionalEddy Vluggen6-Jun-18 11:20 
AnswerRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Hussein Tb6-Jun-18 18:48
Hussein Tb6-Jun-18 18:48 
GeneralRe: cant send file bigger that 1 megabit ( Server_client ) Pin
Peter_in_27806-Jun-18 20:33
professionalPeter_in_27806-Jun-18 20:33 
Questionhow to calculate in c# Pin
denis.larocque5-Jun-18 17:31
denis.larocque5-Jun-18 17:31 
AnswerRe: how to calculate in c# Pin
OriginalGriff5-Jun-18 19:21
mveOriginalGriff5-Jun-18 19:21 
GeneralRe: how to calculate in c# Pin
Richard Andrew x648-Jun-18 12:02
professionalRichard Andrew x648-Jun-18 12:02 
GeneralRe: how to calculate in c# Pin
OriginalGriff8-Jun-18 19:28
mveOriginalGriff8-Jun-18 19:28 
GeneralRe: how to calculate in c# Pin
Richard Andrew x649-Jun-18 2:31
professionalRichard Andrew x649-Jun-18 2:31 
GeneralRe: how to calculate in c# Pin
OriginalGriff9-Jun-18 2:40
mveOriginalGriff9-Jun-18 2:40 
QuestionConvert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
arnold_w5-Jun-18 5:13
arnold_w5-Jun-18 5:13 
AnswerRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
Gerry Schmitz5-Jun-18 5:26
mveGerry Schmitz5-Jun-18 5:26 
GeneralRe: Convert C++ code, with calls to ATL, into C# to quickly get com ports and their friendly names? Pin
arnold_w5-Jun-18 7:15
arnold_w5-Jun-18 7:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.