Click here to Skip to main content
15,916,293 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get last copied/moved file ? Pin
Abhijit Jana1-Jul-08 7:18
professionalAbhijit Jana1-Jul-08 7:18 
GeneralRe: Get last copied/moved file ? Pin
Xmen Real 1-Jul-08 7:24
professional Xmen Real 1-Jul-08 7:24 
GeneralRe: Get last copied/moved file ? Pin
Abhijit Jana1-Jul-08 7:26
professionalAbhijit Jana1-Jul-08 7:26 
GeneralRe: Get last copied/moved file ? Pin
Xmen Real 1-Jul-08 7:34
professional Xmen Real 1-Jul-08 7:34 
Questionadding xmlnode with childs Pin
manoj221841-Jul-08 6:27
manoj221841-Jul-08 6:27 
QuestionGraphics.DrawString() drawing text with multiple colors Pin
shultas1-Jul-08 6:12
shultas1-Jul-08 6:12 
AnswerRe: Graphics.DrawString() drawing text with multiple colors Pin
Luc Pattyn1-Jul-08 6:46
sitebuilderLuc Pattyn1-Jul-08 6:46 
QuestionCustom Receive Pipeline Stream. Pin
Art_Wood1-Jul-08 5:56
Art_Wood1-Jul-08 5:56 
Hi
I have a custom decoder that I have modified. This will stream the message into it and add the name of the file to the end of the message. This has added hours to the process of a large file 85MB+. The files I will be getting from the client will be even bigger. Can someone give me some advice on making the code even more efficient? I'm not sure if it is my code it might be a configuration problem in Biztalk. Here is my code:


public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
        {
            // 
            // TODO: implement component logic
            // 
            
            IBaseMessagePart bodyPart = inmsg.BodyPart;
            IBaseMessage outmsg = null;
            Stream inStream;
            MemoryStream outStream = new MemoryStream();
            byte[] inBuffer;
            byte[] thefilename;
            byte[] outBuffer;
            object tempObj;
            string msgString = "";
            //int endpos = 0;
            string fileName = "";
            string fullPath = "";

            if (bodyPart != null)
            {
                tempObj = inmsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
                if (tempObj != null)
                    fullPath = tempObj.ToString();
                else
                    return inmsg;
                //The filename is to be added to the end of the stream.
                fileName = "*" + System.IO.Path.GetFileName(fullPath) + "\r\n";

                thefilename = ConvertToBytes(fileName);
                inStream = bodyPart.GetOriginalDataStream();
                
                //Define lengths for memory and byte array
                Int32 inStreamLength = Convert.ToInt32(inStream.Length);
                Int32 FileNameLength = Convert.ToInt32(thefilename.Length);
                Int32 TotalBufferLength = Convert.ToInt32(inStreamLength) + Convert.ToInt32(FileNameLength);

                inBuffer = new byte[TotalBufferLength];
                inStream.Read(inBuffer, 0, inStreamLength);
                
                int count = inStreamLength;
                int j = 0;
                while (count < TotalBufferLength)
                {
                    inBuffer[count++] = thefilename[j++];   //Convert.ToByte(inStream.ReadByte());
                }

                outStream.Write(inBuffer, 0, TotalBufferLength);
                outStream.Seek(0, SeekOrigin.Begin);
                bodyPart.Data = outStream;

                //Build a new message, do no just change the bodypart.  Recommended by MS
                outmsg = cloneIBaseMessage(pc.GetMessageFactory(), inmsg, outStream);
                return outmsg;
            }
            else
                return inmsg;
        }


Thanks for the Help

Arthur
Questionwindows vista or xp pro Pin
arkiboys1-Jul-08 5:44
arkiboys1-Jul-08 5:44 
AnswerRe: windows vista or xp pro Pin
Xmen Real 1-Jul-08 5:46
professional Xmen Real 1-Jul-08 5:46 
GeneralRe: windows vista or xp pro Pin
arkiboys1-Jul-08 5:54
arkiboys1-Jul-08 5:54 
GeneralRe: windows vista or xp pro Pin
Xmen Real 1-Jul-08 6:18
professional Xmen Real 1-Jul-08 6:18 
GeneralRe: windows vista or xp pro Pin
Kenny McKee1-Jul-08 7:26
Kenny McKee1-Jul-08 7:26 
GeneralRe: windows vista or xp pro Pin
Xmen Real 1-Jul-08 7:34
professional Xmen Real 1-Jul-08 7:34 
GeneralRe: windows vista or xp pro Pin
Kenny McKee1-Jul-08 14:16
Kenny McKee1-Jul-08 14:16 
AnswerRe: windows vista or xp pro Pin
Kjetil Svendsen1-Jul-08 9:54
Kjetil Svendsen1-Jul-08 9:54 
GeneralRe: windows vista or xp pro Pin
arkiboys1-Jul-08 22:18
arkiboys1-Jul-08 22:18 
QuestionHow could it be Sending & Receiving Object of user class through Socket ? Pin
MehmetFurkan1-Jul-08 5:22
MehmetFurkan1-Jul-08 5:22 
QuestionInstallShield not registering a dll Pin
Russell Jones1-Jul-08 4:36
Russell Jones1-Jul-08 4:36 
AnswerRe: InstallShield not registering a dll Pin
leppie1-Jul-08 4:53
leppie1-Jul-08 4:53 
AnswerRe: InstallShield not registering a dll Pin
led mike1-Jul-08 4:54
led mike1-Jul-08 4:54 
GeneralRe: InstallShield not registering a dll Pin
Russell Jones1-Jul-08 5:01
Russell Jones1-Jul-08 5:01 
GeneralRe: InstallShield not registering a dll Pin
led mike1-Jul-08 7:38
led mike1-Jul-08 7:38 
GeneralRe: InstallShield not registering a dll Pin
Russell Jones1-Jul-08 21:20
Russell Jones1-Jul-08 21:20 
Questionhow to add new node existing treeview control and bind data from table? Pin
Ashish Kumar Vyas1-Jul-08 4:35
Ashish Kumar Vyas1-Jul-08 4:35 

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.