I'm searching anyone who like to participate to a new open source project team core , if you are interset , please come here to know more:
I like to discuss more:
I want to write a custome disassembler that process a file that comtains diffrent special symbols as seperators like (^,&,| etc.) and the result will be use to make a xml file, that i will furtur use for different purposes.
so has anyone ever done something like this? Can you shred some light for me? Or do you have any suggestion?
sorry for my bad english, i hope you unterstand me
you have to do 2 things: (for BizTalk 2006)
1. write a pipeline that receive the inputmessage. than manipulate it. (see code below)
2. write a disassembler that receive the manipulated message and create the xml message. (see code below)
Pipeline for manipulating the inputmessage. RemoveString and ReplaceStringOld are
properties in the class. you can change this properties in the admin console at runtime. this methode replace CR an LF from the inputmessage and return it.
/// Implements IComponent.Execute method.
/// <param name="pContext" />Pipeline context
/// <param name="pInMsg" />Input message
/// <returns>Original input message
/// IComponent.Execute method is used to initiate
/// the processing of the message in this pipeline component.
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pContext, Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg)
//Obtain the string of the original message
String inputMessage = string.Empty;
using (StreamReader streamReader = new StreamReader(pInMsg.BodyPart.Data, System.Text.Encoding.Default)) //.GetEncoding(this.Encoding)))
inputMessage = streamReader.ReadToEnd();
//CurrentEncoding = streamReader.CurrentEncoding;
if (RemoveString != null)
inputMessage = inputMessage.Replace(RemoveString, String.Empty);
if (ReplaceStringOld != null)
inputMessage = inputMessage.Replace(ReplaceStringOld, ReplaceStringNew);
inputMessage = inputMessage.Replace("\r", "");
inputMessage = inputMessage.Replace("\n", "");
MemoryStream origms = new MemoryStream(System.Text.Encoding.Default.GetBytes(inputMessage));
origms.Position = 0;
pInMsg.BodyPart.Data = origms;
this is the disassembler class methode that receive the manipulated message and return a XML document.
/// Builds the interchange from the messages that were added by the previous method.
/// Returns a pointer to the assembled message.
/// <param name="pContext" />the current pipeline context
/// <returns>the assembled message instance
public Microsoft.BizTalk.Message.Interop.IBaseMessage Assemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pContext)
using (MemoryStream inMemoryStream = new MemoryStream())
XmlDocument xmlDocument = new XmlDocument();
Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg = (Microsoft.BizTalk.Message.Interop.IBaseMessage)_inmsgs;
I's like to have a dialog box to browse for folder and select folder path just like OpenFileDialog does for selecting files. ideal to browse network/unc path
The FolderBrowserDialog doesn't allow a user to type in a path, and is generally less usefull. What I'd like is what's used inside Visual Studio to select folders.
I've been trying to use multithreading on a socket but without success. Here is what I want to do: I have a socket that is shared by two threads. One of them is continuously blocked on a Receive and the other one sends bytes (asynchronously) through the same socket. However, I can't do both things at the same time. If I have the first thread blocked on a Receive, when I use the other thread to send bytes I get an exception in the former thread saying something that an existing connection was forced to close by remote host...
void SocketRW::readSocket(Object^ sender, DoWorkEventArgs^ e)
Array::Clear(buffer, 0, buffer->Length);
bytesrec = socket->Receive(buffer);
// Whenever the other thread sends bytes through this socket, the Receive method above throws an System.Net.Sockets.SocketException with the message I posted above.
e->Result = bytesrec;
void SocketRW::fireMsg(Object^ sender, RunWorkerCompletedEventArgs^ e)
// do stuff with the message in "buffer"
// Need this in order to update the GUI with the correct thread
You have identified your problem. If you intend to use a single buffer for sending and receiving, then your receive must not block. Instead of causing the receive thread to not block, use separate buffers for reading and writing. Then you won't need a mutex to control access to the buffer.
Thanks for your reply, but of course I'm not using the same buffer for sending and receiving. I just protect the receiving buffer because it is used in the BackgroundWorker method (for the Socket::Receive() method) and in the RunWorkerCompletedEventHandler (which runs in the main thread context, the same thread that is used to send bytes through the socket).
I have a multiple instances that bind and listen to the same UDP (with same IP and Port #).
Is it possible to do that?
I set my UDP socket to REUSEADDRESS, but it seems only 1 instance receives the data. The rest are not.
We are presently upgrading from .Net 2003 to 2005. We have an application that invokes an FTP client asynchronously via a process component, redirecting standard output to a log file. In .Net 2003, all of standard output is redirected to the log file, however, in .Net 2005, only the commands we are passing to the ftp client are redirected to the log file. All of the FTP responses ie: “1000 bytes transmitted in 2 seconds”, etc. are not redirected to the log file.
The relevant lines of code are as follows:
Dim myProcess As New Process
myProcess.StartInfo.FileName = "FTP.exe"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardOutput = True
Dim myStreamReader As StreamReader = myProcess.StandardOutput
Dim myStreamWriter As StreamWriter = File.AppendText(“myLog.txt”)
While Not sLine Is Nothing
sLine = myStreamReader.ReadLine()
Does anyone know if changes were made with regard to the redirect of standard output for process components?
Thanks in advance for your replies.
Perhaps it would be better to just start the process you want to debug and then use the debug process to hook into the thing you want to debug. If one of the projects you are trying to debug is a windows service, using the debug processes is a good way to debug.