|
About 2 gigabytes... (in bytes that is, so that's 1 Gb of DBCS (i.e. Unicode-16 (i.e. 2 bytes per character)))
I don't think you'll reach that limit quick, and if you do it might be a good time to look into some streaming classes.
Regards,
Jeroen Landheer.
|
|
|
|
|
when ever i want to change from design view to code view it goes through a save routine that last about 45 seconds at this rate ill never finish what is going wrong
|
|
|
|
|
This is at least the third time you've posted this question and I've already answered you once. Please quit asking over and over again. It's pointless to keep asking.
1. Abstract your TabPage s.
2. Quit using the designer and write some real code.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i agree but i am so far in with this page now and worried about the time scale it will take me to write all the code needed to create my page objects and as i work on my own and not with a team of skilled developers the learning curve takes that bit longer. I would love to be able to use a more OO concept.
|
|
|
|
|
Why would it take so long? You've already got all the initialize code. Create classes for each TabPage and copy the relevent code, paying a little attention to fixing any problems you might see in there.
Relying on the designer is not a good way to learn anything. You're not actually writing code in that case - the IDE is doing it for you. Here's a chance for a real learning experience.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
can i email some one the form to test it for me?
|
|
|
|
|
Hello All,
I am student from India. Right now i am working on one on course project in C# and COM+ components.In that project i want to implement security through any hardware like floppy or CD. I try the 'VOL' command from command line to get the hardware Volume serial number like Floppy or CD. I i notice one thing that it is not uniq. If u make ISO of that Floppy or CD and write it then the Volume serial number will be the same. So there is no uniqueness in this. I want to implement security in my code from any hardware. How can i implement that one. If any one have good Knowledge about that Please mail me at Hemant_Mane2003@yahllo.com.
And if there is more secure way than the encryption and decryption please sent me that stuff or guide me about that.
Thanking You.
(Hemant Uttam Mane)
|
|
|
|
|
See my article, Using XML Digital Signatures for Application Licensing[^]. You can include anything you want. You could, for example, using WMI to easily get the volume ID of the system partition (the partition from which the current OS is running) and have them send that as part of a request which you sign and send back. In your application - besides checking the validity of the license - you get the volume ID again and verify that the two are the same.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Because .NET uses the IL (intermediate Language), it can always be backwards engineered. You can use an obfuscator to make the code in the resulting executables less readable, but at one point the framework still needs the IL from the file... RemoteSoft has created a tool called Protector that creates C++ like files which are very dificult to backwards engineer. But that tool costs $1899 for 5 developers.....
If you just want to use crypto in your app, you could try this book:
.NET Security and Cryptography, by Peter Thorsteinson and G. Gnana Arun Ganesh. It covers all aspects of Crypto available in .NET and also the security model.
|
|
|
|
|
Hi gurus,
I am currently testing the TcpListener and TcpClient classes from System.Net.Socket to try to send data from a pc to another.
I have inserted a static control that displays the status of the connection.
I do the following code:
<br />
...<br />
Int32 port=Int32.Parse(txtPort.Text);<br />
NetworkStream stream=null;<br />
Socket socket=null;<br />
<br />
m_server=new TcpListener(IPAddress.Any, port);<br />
m_server.Start();<br />
<br />
while (true)<br />
{<br />
lblStatus.Text="Waiting for a connection...";<br />
Debug.WriteLine(lblStatus.Text);<br />
socket=m_server.AcceptSocket();<br />
<br />
...<br />
When I check the output I can see the message "Waiting for connection..." (that's what I wanted) but the form seems to be completely frozen once the call to socket=m_server.AcceptSocket() is done.
Should I write this function in a separate thread? Then the interface could answer to the OnPaint events like in C++? If I have to write a thread for what I'm doing, where I can I get a sample code for it?
Thanks for the help.
Best regards.
There is no spoon.
|
|
|
|
|
There's plenty of examples of threading socket connections here on CodeProject. When you get and set properties on a control or form, however, you must invoke the call so that it executes on the main UI thread otherwise you'll run into problems. See Control.Invoke and Control.InvokeRequired for more information and an example of how to use them.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
ok, I'm going to check this way
There is no spoon.
|
|
|
|
|
|
ok, thanks. I'm going to explore this way.;P
There is no spoon.
|
|
|
|
|
Hello all!
I am tasked to work on a project that draws moving objects on the screen dynamically using the co-ordinates and data provided through a stream, let's say a FileStream. I also would like to be able to "delete" the object from the screen. The method(s) that I have been using is that I used Threading to extract the co-ordinates and other info from the FileStream and map them on the screen. By doing this, the screen is littered with objects since the old objects have not been getting rid of. I have tried re-painting the "old" objects with the color same as the background so that they would "disappear". As I tried to do that, the program kept crashing on me. I guess that I don't have an efficient code to manage the buffering.
So, if have experienced with graphics in the past, please give me some hints. Thanks a whole lot in advance!
Tim
|
|
|
|
|
Just keep a reference to these objects and either dispose of them or simply move them to new coordinates. If you create new controls each time you read from the stream, you need to dispose those objects. If it's simply a matter of repainting, then make sure you're repainting the background and then the these other objects so that the "old" objects are not still painted on the on-screen bitmap.
Without knowing more about your implementation, it's difficult to answer your question.
Just consider how controls are painted on a form, though. Each control that is contained in the Controls collection property is sent the WM_PAINT message and paints itself after the container has invalidated it's surface, repainting the background as necessary. This is basically how all painting is done by the Window manager (i.e., Windows).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
When managing our .NET projects with Visual SourceSafe, we encounter this problem:
DeveloperA works on a .NET project. This project has a reference to a COM object. DeveloperA checks in his files into SourceSafe.
Next day, DeveloperB works on the same .NET project. Although he has the same COM oject installed on his computer, the reference is invalid (indicated by a yellow triangle with an exception mark inside). DeveloperB has to delete the reference, and set a new reference to the same COM object.
Is there any way to avoid this deleting and re-creating of references?
|
|
|
|
|
DeveloperB doesn't seem to be getting the interop assemblies created by DeveloperA. We put our interop assemblies used throughout our application in SourceSafe as well, which SourceSafe does not do by default (it doesn't add assembly references, only project files). The project still thinks it's there, however, since the .csproj file has a reference to that assembly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I want to create an owner drawn track bar,
to look something like a volume control, i.e.
<br />
*****<br />
****<br />
-----<br />
**<br />
*<br />
something like that....
any hints for me?
|
|
|
|
|
I have absolutely no idea what you mean...
Do you want to do this in a console / on a form? webpage?
-Ernst
There are only 10 kinds of programmers - those who understand binary, and those who don't.
|
|
|
|
|
Yeah, don't extend the TrackBar because you'll have a much more difficult time painting what you need since the TrackBar control simply encapsulates the native Trackbar common control. Instead, just create your own Control from scratch that works in a similar fashion (besides, a control like you want probably doesn't need to draw tick marks anyway).
There are several articles I've seen here on CodeProject regarding such controls. I suggest you search CodeProject to find examples.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I am trying to open a word template that has auto macros that fire when the template is opened. I need to disable these programmatically.
In Delphi you can use the following to achieve this:-
OleVaraint(myWordApp.WordBasic).DisableAutoMacros;
myWordApp.Documents.Open(blaa...blaaa...blaa...
I really need a way to do this in C#
Any help would be most appreciated.
P.S. Anybody know any other good places to ask?
|
|
|
|
|
Which version of Word is it? The delphi code you post is COM automation code - you might try creating a wrapper for that type library, and reference it in your .NET project - you should then be able to do the same in C#.
HTH!
-Ernst
There are only 10 kinds of programmers - those who understand binary, and those who don't.
|
|
|
|
|
I think I'm being some what thick and this is my 3rd day with C# but I'm not sure what type library I'm supposed to wrap.
I'm using the Microsoft Word 10.0 Object Library.
It has a Word.Application.WordBasic property but it is of type object. I am unsure what I should cast it to to simulate the Delphi code.
Also I think WordBasic is no longer used much. The Application object model is supposed to have replaced its functionality. However I still cannot find a similar method/property. It should be simple but it's driving me nuts.
Some times I hate programming.
Dominic Godin.
|
|
|
|
|
The thing about OLE automation (and COM in general) is that it works practically the same in whatever language you use as a client (though the syntax may be slightly different).
Unfortunately, ApplicationClass.WordBasic returns an object and because of the Common Type System - a component of the .NET Framework - you can't simply call the method like you could in Delphi or VB (which internally uses the DISPID to invoke the dispatch function with any DISPARAMs you might specify).
There is a way, though, and it's not too easy. You need to declare the IDispatch interface in COM (merging the IUnknown methods in the same interface - do not inherit from a declared IUknown ). Then you call IDispatch.GetIDsOfNames to get the DISPID for DisableAutoMacros , and then use that in the call to IDispatch.Invoke .
The last line is easy and there are many eamples here on CodeProject that show examples, though it's pretty easy. The following is, of course, the method signature for Documents.Open :
public Document Open(
ref object FileName,
ref object ConfirmConversions,
ref object ReadOnly,
ref object AddToRecentFiles,
ref object PasswordDocument,
ref object PasswordTemplate,
ref object Revert,
ref object WritePasswordDocument,
ref object WritePasswordTemplate,
ref object Format,
ref object Encoding,
ref object Visible,
ref object OpenAndRepair,
ref object DocumentDirection,
ref object NoEncodingDialog); So, if you wanted to open a document and don't want/need to provide all those parameters, you can simply using Missing.Value (or null ):
object fileName = "C:\Example.doc";
object missing = Missing.Value;
Document doc = app.Documents.Open(ref fileName, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing); If you wanted to open the document as read-only, add the following line before calling Open and change the third parameter to ref readOnly :
object readOnly = true;
Microsoft MVP, Visual C#
My Articles
|
|
|
|