|
If their IP is invalid, no-one can.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
The two clients have server IP (it is valid) and connect to it, and server must create a communication between them (with two different ports).
How server can do ihis?
|
|
|
|
|
Ah... What was invalid then ?
The way to do this, is that the server sends each client the other client's IP address, then they can talk directly.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello Every body,
I had develop an desktop application in c# with dotnetframwork 2.0. The application is working fine but i am facing problem in crystal report.
I am getting the following error message :
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.Runtime.InteropServices.COMException (0x800736B1): Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 800736b1.
at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()
at alokInventorySystem.outsideDelhiCustomerInvoice..ctor()
at alokInventorySystem.printInvoice.printInvoice_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
alokInventorySystem
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/AspDotNet/AlokInventorySystemSetUp/alokInventorySystem.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
CrystalDecisions.Windows.Forms
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Windows.Forms/10.2.3600.0__692fbea5521e1304/CrystalDecisions.Windows.Forms.dll
----------------------------------------
CrystalDecisions.Shared
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Shared/10.2.3600.0__692fbea5521e1304/CrystalDecisions.Shared.dll
----------------------------------------
CrystalDecisions.ReportSource
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportSource/10.2.3600.0__692fbea5521e1304/CrystalDecisions.ReportSource.dll
----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
CrystalDecisions.CrystalReports.Engine
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.CrystalReports.Engine/10.2.3600.0__692fbea5521e1304/CrystalDecisions.CrystalReports.Engine.dll
----------------------------------------
CrystalDecisions.ReportAppServer.CommLayer
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.9700.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.CommLayer/10.2.3600.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.CommLayer.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box
Regards,
rahul saini
|
|
|
|
|
This error raises when you use installed application? If yes, have yo included Crystal Reports Merge Module? If not you, the cause maybe this.
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Hi,
Sorry I was out of town.
Actually this error occur when the report is generated not at the time of installation. I was working fine but as the system reboots this problem occurs at the time of report generation.
Regards,
rahul saini
|
|
|
|
|
public ArrayList listcht = new ArrayList();<br />
byte[] comparar = new byte[10];<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x20;<br />
comparar[4] = 0x56;<br />
comparar[5] = 0x69;<br />
comparar[6] = 0x73;<br />
comparar[7] = 0x69;<br />
comparar[8] = 0x6f;<br />
comparar[9] = 0x6e;<br />
listcht.Add(comparar);<br />
<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x31;<br />
comparar[4] = 0x76;<br />
comparar[5] = 0x73;<br />
comparar[6] = 0x31;<br />
comparar[7] = 0x48;<br />
comparar[8] = 0x61;<br />
comparar[9] = 0x63;<br />
listcht.Add(comparar);<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x43;<br />
comparar[4] = 0x75;<br />
comparar[5] = 0x73;<br />
comparar[6] = 0x74;<br />
comparar[7] = 0x6f;<br />
comparar[8] = 0x6d;<br />
comparar[9] = 0x4b;<br />
listcht.Add(comparar);<br />
}
The problem here is the comparar[] array byte can't assign the new values
why? they maintaine the old values.
well, the sort soluction is redeclare the array
|
|
|
|
|
When you add the array to the list, it's not copied. The list is just a list of references, and you add the reference to the array, not a copy of the array.
You add the same array three times to the list, so all the items in the list will be the same actual array. When you change the contents of the array, it will change the contents of all items in the list, as they are all the same object.
---
single minded; short sighted; long gone;
|
|
|
|
|
Good Day Gents/Madam,
I am wondering if there is a way to convert a certain file(.EXE,.JPG) to Binary/Byte and put them back together?
For example, I have a certain Picture.jpg. I want to convert it to binary/Byte, and save it as a TEXT FILE. Now I want to take that TEXT FILE and convert it back to JPG.
Is this possible? If it is, is the proccess of converting a JPG similar to converting other file types like .EXE?
Thank You for your time.
-- modified at 1:51 Saturday 13th October, 2007
|
|
|
|
|
Ian Uy wrote: I am wondering if there is a way to convert a certain file(.EXE,.JPG) to Binary/Byte and put them back together?
Yes, use CopyFile(...)[^] the new copy of the file is converted into binary. To convert back to .exe or .jpg format use CopyFile(...) in reverse.
|
|
|
|
|
I was thinking of doing some manipulations with the byte/binary stream before saving them as a text file.
So I need to have them in the memory or in a Byte type.
|
|
|
|
|
Ian Uy wrote: So I need to have them in the memory or in a Byte type.
As Mav said all files are written in bytes. I suggest you study the subject of files more to gain a better understanding.
|
|
|
|
|
Hi!
Not quite sure what you mean by "Binary/Byte" - every file (no matter if it is a jpg or a doc or something else) is just a bunch of bytes in a certain order.
The only meaning implied on this stream of bytes is the one given by applications that can interprete the data in a given way.
When you try to load a .doc file into your favourite image processor (probably having to rename the file to do so), it'll choke on the data because it cannot be interpreted as an image.
Anyway, you can read any file into a byte array using classes from the System.IO namespace and then get a base64 string from this array using Convert.ToBase64String() .
This base64 string is something you can write to a text file (i.e. a file with all of its bytes in the limited range of printable characters).
The way back is straightforward: Read the base64 string from the text file, convert it to a byte[] with Convert.FromBase64String() and write the array to a binary file.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks for the reply.
I meant about the Byte/Binary is the Byte data type.
What I want is to convert a FILE to Byte, meaning instantiate the Byte data type with the contents of the File. Like:
Byte[] ByteArray = [Byte_of_File] //Is this even possible O_o?
I want it this way because I want to do some modifications on the Byte_of_File itself and after some modifications, I want to write it as a text file. (Filestream?)
After that, I want to reverse the process by reading the text file(Filestream), saving the contents of the text file to a ByteArray, undoing the modifications, and export them back as a workable file.
Am I talking junk or is this possible?
Thank You
|
|
|
|
|
Ian Uy wrote: Am I talking junk
Yes
|
|
|
|
|
Ouch.
But Sir, is this possible to do even it its "junk"?
Thanks.
|
|
|
|
|
You can READ bytes from a file. There's no conversion.
Simply use "byte[] byteArray = System.IO.File.ReadAllBytes(fileName);".
|
|
|
|
|
Thanks for the reply.
How can I do the reverse proccess? I mean, from byte to file. Thanks.
|
|
|
|
|
Perhaps there is a method with a name that is the opposite of Read . Write perhaps?
|
|
|
|
|
Ian Uy wrote: I am wondering if there is a way to convert a certain file(.EXE,.JPG) to Binary/Byte
The files are already binary data. All files are always binary data, even text files are binary data. It's only when you read a text file as text that it becomes text, otherwise it's only bytes.
Reading a file is quite easy:
byte[] data = File.ReadAllBytes(@"c:\test.jpg");
Ian Uy wrote: For example, I have a certain Picture.jpg. I want to convert it to binary/Byte, and save it as a TEXT FILE.
You can't save binary data as text. If you want the binary data as text, you have to convert it, for example using base 64:
string dataText = Convert.ToBase64String(data);
Each character (which is a 16 bit unicode character) now contains 6 bits of information. Now you can save the string as a text file.
(Note that the text will be encoded to binary format (usually using utf-8 encoding) when saved as a file, as files always are binary.)
When you have read back the text file as a string, you can convert it back to the original data:
byte[] data = Convert.FromBase64String(dataText);
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you for the reply Sir Guffa.
Now that I have the data back to byte array. By using this:
byte[] data = Convert.FromBase64String(dataText);
How can I turn it back to c:\test.jpg
Thank you again.
|
|
|
|
|
Take a look at the File.WriteAllBytes method.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have written a report to print labels which works quite well as long as a full sheet is to be printed. Unfortunately in the real world people rarely print full sheets of labels. Instead they need to be able to specify a column and row to begin printing.
The label report is actually a horizontal report that prints three rows then moves to the next column prints three rows and so on. The names and addresses are pulled from a SQL Server 2005 database.
Is there a way to send printer codes to the printer to position the print head before printing begins?
I've even thought about using dummy records to get the printer to skip to the right record, but I'm not sure how to do that or if it would even work.
Any suggestions are appreciated.
|
|
|
|
|
Roger CS wrote: Any suggestions are appreciated.
I suggest you do some reading about how to do printing[^]
|
|
|
|
|
Anyone here who actually knows how to do what I'm asking about?
|
|
|
|