|
well in that case, create the license on the serverside for every new instance of the application and have it check against it, the only difference would be is to sign a new license everytime when the client connects to server with the minor difference of have append some kind of random string along with the computer name, or CID name or something like that.
changing license on the FLY for every invocation.
|
|
|
|
|
here is the application i am developing
http://speechtoolscenter.com/Products.htm
This is the dumbest website i have everdone, for some reason i hate doing webpages.
|
|
|
|
|
Hi folks!
I'd like to create a configurable hotkey assignment for my application. When a hotkey is pressed, a menuitem in my application should be invoked.
Creating these assignments within code is trivial, but I want the assignments to be configurable by the user and to be serializable, so that the user can save his/her assignment after configuration and load it again.
Unfortunately, MenuItem isn't marked as Serializable, so I don't know how to save the MenuItem the user wants to invoke with a given hotkey...
Any ideas how to approach this issue?
Thanks in advance,
mav
|
|
|
|
|
Hi!
Try creating your menus at run-time instead of design-time. And you can assign the hotkeys you want for each one of them based on the previously saved hotkeys (only these need to be saved).
Regards
|
|
|
|
|
Thanks for the reply, but unfortunately that's not the point.
When I want the user to be able to configure the assignment I have to save the information which hotkey is assigned to which menu item. The hotkey part is easy, I just don't know how to uniquely identify a MenuItem.
One idea was to save the member name of the MenuItem and then, when loading a set of hotkey assignments, to retrieve the correct instance using reflection, but that's rather clumsy and cannot be encapsulated well.
Right now I'm trying to save the path to the MenuItem (something like "\E&xtras\&Format\&Defaults") and then, when a hotkey is pressed, find the correct menu item by iterating through the main menu items and their subitems using this path.
This does work and since the path is just a string the whole assignment can be serialized nicely, but it also makes the assignment dependent on the exact menu item names. Using the same assignment for different languages is not possible.
Because it's also possible to customize the menu itself (for example to hide unneeded menu items) I can't use the MenuItem's index within the parent menu instead of the item text, because this can get messed up as well...
It's too bad that MenuItem doesn't have a Name or Tag property or else I could use this. That's why I was asking for any other glorious idea on how to handle the assignment in a robust and flexible way...
Thanks,
mav
|
|
|
|
|
Ive set up the simplest of all remoting examples, a simple service hosted by a server (single call) and a client that calls a method on the service object. That works great I get my results, but when I quit the client, the server crashes with a null pointer exception. Other examples I've downloaded and compiled and run behave in the same way.. Anyone?
|
|
|
|
|
Without code snipets and more detail there is any number of reasons why the server could and would crash. I suspect you are doing something you shouldn't to the remote object on the "application exit event".
|
|
|
|
|
Sorry for not posting any code. As I said before, all the samples from tutorials fail in the same manner.
Heres the service:
public class HelloService : MarshalByRefObject<br />
{<br />
public string hello()<br />
{<br />
Console.WriteLine("Hello!");<br />
return "Hello";<br />
}<br />
}
Here's the server:
class HelloServer<br />
{<br />
static void Main(string[] args)<br />
{<br />
Console.WriteLine("Hit any key to exit at any time");<br />
<br />
try<br />
{<br />
TcpServerChannel channel = new TcpServerChannel(8088);<br />
<br />
ChannelServices.RegisterChannel(channel);<br />
RemotingConfiguration.RegisterWellKnownServiceType(typeof(HelloService), "HelloService", WellKnownObjectMode.SingleCall);<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine(e.Message);<br />
}<br />
<br />
Console.ReadKey();<br />
}<br />
}
And here's the client:
class HelloClient<br />
{<br />
static void Main(string[] args)<br />
{<br />
Console.WriteLine("Press any key to exit at any time");<br />
<br />
try<br />
{<br />
TcpClientChannel channel = new TcpClientChannel();<br />
<br />
ChannelServices.RegisterChannel(channel);<br />
HelloService service = (HelloService)Activator.GetObject(typeof(HelloService), "tcp://localhost:8088/HelloService");<br />
<br />
if (service != null)<br />
Console.WriteLine(service.hello());<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine(e.Message);<br />
}<br />
<br />
Console.ReadKey();<br />
}<br />
}
|
|
|
|
|
Are you running them both in the (same) debugger together? (i.e. using debug->start new instance from the context menu of the solution window?)
If so, the console object is destroyed when you exit either one... try running them in separate instances of VS.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Thanks for the replies..
Nah I'm running them separately outside of VS. I've tried both debug and release modes. To me it sounds like the client needs to release something or tell the server about its disposal but it just doesn't make any sense.
|
|
|
|
|
Hi There Friends,
How Can I Scroll an scrollable control (like listview listbox) manually?
they dont have scroll method.
|
|
|
|
|
Hello Ali!
If you set the AutoScroll property to True then you can scroll your control using the following sample code
ConrolName.AutoScrollPosition = new Point(XVal, YVal) // here XVal refers to horizontal scroll and YVal refers to Vertical Scroll value.
When you read the value of AutoScrollPosition property, it returns negative values, but, you must set positive values to scroll the control.
I hope it works.
|
|
|
|
|
|
hey guys! (sorry about my english)
so, i know the great tool dcomperm.exe, but i don't want use this .exe..
what i realy want is: to use a .net assembly with all existing functions on dcomperm.
so i just start to rewrite my own dcomperm in c#, but..! its a LOT of work.. its almost insane...
1- so, anyone know a finished .net component or something like that??
2- i try to convert the C++ unmanaged dcomperm code(from samples VS 6), to
C++.net, but im not so close to C++ code, its a hard work.. it would be a easer workaround??
thanks a lot guys..
if i get finished my own dcomperm, i'll build a codeproject article
to share it!
blitzkrieg bop!!
|
|
|
|
|
Hi
Using C#, how can I break a string into separate words. For instance, " my search string, and some-other-string"
becomes "my" "search" "string" "and" "some-other-string"
Notice, that I have removed spaces and commas, but kept the dashes in my words.
So any idea how I can remove spaces, commas and break a string into separate words??
Kind regards
|
|
|
|
|
You can do it by using Substring() method, or by Split() method, but the last one requires that there is a separator, this separator may be the " " Char.
"Praying." Is this only what I can do for him ?
|
|
|
|
|
If your string is not that large, you can use the Split[^] method on System.String . Something like
string []words = sentence.Split(new char[] {' ', ','});
You need to watch out for empty strings in words though, two successive delimiters will result in an empty string.
If your string is large or your parsing logic is complex, you can try using theRegex[^] class.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
i need a file stream object but just in memory.
That is i dont want a StreamWriter that write a file on the HD or a StreamReader that read one from the HD, i need:
Stream mstream
but i can't becouse i can inistialize it with:
new Stream();
so how can i do?
|
|
|
|
|
Use the System.IO.MemoryStream[^] class. StreamReader accepts any stream, so you can pass a MemoryStream instead of the FileStream.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
-- modified at 7:54 Friday 21st October, 2005
|
|
|
|
|
Have you tried the MemoryStream class is System.IO?
|
|
|
|
|
Hey everybody!
I am trying to create an ImageList to add pictures to my toolbar.
I am doing that using the design mode of VS.net.
anyway, after I am adding an Image to the ImageList, VS adds this code to the properties of the ImageList object:
this.imageListToolbar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListToolbar.ImageStream")));
and when I run the program I get "System.Reflection.TargetInvocationException" exception in this line.
I really have no idea why it happens or how to fix it...
can anyone help me with that????
THANKS!
|
|
|
|
|
Did you change the namespace or classname after you added the image list? I've seen that cause problems. If you did that, try changing the "Default Namespace" entry in the Project properties dialog to the new namespace.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
no, I didn't change anything like that.
I get that error even if I am openning a new project, and adding an ImageList, and than adding to it an image.
I'm getting the same exception.
|
|
|
|
|
|