|
Ok, it would appear that I have misundestood how serialport works. It is not posible to receive and event notification for every byte. I will therefore have to use the readbytes method and then itereate through all recieved.
|
|
|
|
|
Yep, SerialPort.ReceivedBytesThreshold "gets or sets the number of bytes in the internal input buffer before a DataReceived event occurs", i.e. there will be an event as soon as that number or more data
bytes are available, and the driver may offer more than one byte at a time, so no you will not get
an event for every byte (which would be very inefficient performance wise anyhow).
|
|
|
|
|
i use unmanaged code [odbc32.dll] to get the list of Sql Server on Network can any body tell me that this code will run on 64bit Computer Server smoothly
wasim khan
|
|
|
|
|
Shouldn't see any reason why not. Why don't you try testing it on the server 1st?
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
i have 32bit server and i have not any 64bit server
wasim khan
|
|
|
|
|
Hell EveryBody,
I have a webservice in a server.And in another server I have a webApplication. When i use the webmethod of the webservice in my webApplication I got the following error.
I had already used this code, but no result.
webservLeave.PreAuthenticate = false;
webservLeave.Credentials = System.Net.CredentialCache.DefaultCredentials;
or
webservLeave.Credentials = System.Net.CredentialCache.DefaultCredentials;
The request failed with HTTP status 401: Unauthorized
plz help me out.
A key to every Solution
|
|
|
|
|
AS@13 wrote: The request failed with HTTP status 401: Unauthorized
Looks like anonymous access is not enabled. Allow anonymous access in the server or supply valid credentials instead of default credentials.
|
|
|
|
|
I had already done this,but no result.
plz tell me some other option.
my code is as below....
MyWS.Service webservLeave = null;
if (webservLeave == null)
{
webservLeave = new MyWS.Service();
}
webservLeave.PreAuthenticate = false;
webservLeave.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
webservLeave.Credentials = CredentialCache.DefaultCredentials;
webservLeave.MyWebMethod();
Thanks in Advance
A key to every Solution
|
|
|
|
|
Did you try to call .asmx file from explorer?
You can see your webService methohds. Are there any methods?
If there aren't any methods you must edit WebService application's security in IIS.
|
|
|
|
|
yes boss,
I had check it from Internet Explorer.It runs fine and also shows the desire method.
Problem occurs when I access it though my app.
A key to every Solution
|
|
|
|
|
I did a new webService and I used it in a webApp.
WebReferances => MyNewWebService...
MyNewWebService.MyMethods mm = new MyNewWebService.MyMethods();
double dd = mm.CalSum(1d, 155d);
in IIS:
MyWebService => Properties => security
it has :
Everyone read&execute rights,
IIS_IUSRS read&execute rights.
voila... it is working.
and I didn't use credentials to call methods...
|
|
|
|
|
Hi,
I had done this.
But no result.
plz give me a optimize solution.
Thanks in advance
A key to every Solution
|
|
|
|
|
Hello,
I'm using WebDeployment to deploy (to install) an intranet web application. I compile all aspx.cs class to one DLL. I have 2 more DLL that are personal libray and that are used by my application. So, I have actually 3 DLL. I would like to use NGEN to create DLL in native code during project installation.
NGEN INSTALL MYDLL1.DLL
NGEN INSTALL MYDLL2.DLL
NGEN INSTALL MYDLL3.DLL
Could you tell me how to use NGEN with WebDeployment Project to register my three DLL ? Have I to add command line in project file (XML) - witch section ?
Second point: I would like also to use Dotfuscator community 3.0 with WebDeployment - if you have an article on the subject it would be great ! I have tried by when method are renamed to aa, bb, cc. the application don't found anymore the methods of my project...
Regards,
La Richesse & la Gloire ne griseront jamais que les temples
|
|
|
|
|
Merlin Tintin wrote: I would like to use NGEN to create DLL in native code during project installation.
Why do you want to do this? There are very specific reasons for deploying NGEN'd assemblies and specific problems they solve. It's not a general purpose "hammer".
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
I agree with Scott here. I can't think of any good reason to use NGEN on a web app.
All NGEN does is pre-JIT the IL to native assembly. This has lots of implications as it means the CLR can no longer run optimisations as it jits. The CLR is very effcient, it can often optimise things as it goes along because it knows the context it is running in. By using NGEN you remove that optimisation.
The normal performance benifit associated with NGEN is improved cold start up times as the CLR doesn't have to jit compile methods before it can run them. Once the app is started though, the CLR caches jit compiled stuff so it doesn't have to do it again. By the very nature of a web app, cold start up time is irrelevant, it is just continuously running, so only the very first user will experience any slow down related to jitting, after that, the assembly is cached and no more jit compilation is required.
Simon
|
|
|
|
|
I agree with you for optimization - but optimization is not my main goal. My main goal is to protect the embeded code of my page and the framework that I put on the client server. My application is installed on all over the world on server that are the property of clients. So, I would like to use NGEN to put my code less (easier) readable.
Fo that I have a plan. Each point is pretty simple to complete but the whole thing is more difficult because each feature is not predict to use other.
Here is my steps to protect the .NET code (as strong as possible)
- sign the assembly
- All code of pages are in not single class but in a global DLL. This is realize with WebDeploymentProject
- Compile in native code (NGEN). Put the code less readeable for decompilation.
- Obfusacte the code with Dotfuscator Community 3.0
I realize each step without any problem but I cannot figure out how to implement everything together.
ps: I have a click one install to install the web application.
I hope this is more clear for you and I'm open to any other suggestion to protect the code efficiently.
La Richesse & la Gloire ne griseront jamais que les temples
|
|
|
|
|
NGEN is meant to improve startup-time, it's not meant to protect your code.
AFAIK there's no way to use an NGEN image on its own, you must also ship the original .NET assembly.
|
|
|
|
|
Ahh, I see. Interesting Idea, but unfortunately that won't work.
NGEN takes your IL assembly and compiles it to processor specific machine code, and places this machine code in a native image cache on the PC that NGEN was run on. You can't then copy this machine code onto another PC. You also can't delete the original IL assembly as that will also delete the machine code from the native image cache.
What happens when you run your app then is the CLR first checks the native image cache to see if it's already been compiles, if it finds stuff in the cache it uses that.
running NGEN on an assembly gives you no extra protection from disassembly. It can still be disassembled and reflected on. All the meta data included with a normal assembly is still present.
If you are concerned with clients seeing your code your only real option is an obfuscater.
(Signing the assembly does not prevent it being viewed, it only means other people can identify it as your work. Other people can even still change it, but if they change 1 assembly, they have to recompile them all as signing with a strong name ensures other assemblies will only call the original one they were referenced to.)
Ultimately, C# (even with an obfuscater) is not 100% foolproof at hiding code. If you have critical proprietary algorithms that must be hidden, most people would recommend implementing the critical bits in unmanaged code.
Simon
|
|
|
|
|
Hello,
I have written a method to process shortcut entries in my main form that simply dispatches messages to related methods for the button presses. But my problem is that when Key.Left or Key.Right is pressed for the "first" time, KeyDown event is not triggered for my following method:
KeyPreview property of main form is set to true,
private void shortcutKeyDown(object sender, KeyEventArgs e)
{
if (!e.Control && !e.Alt && !e.Shift)
{
switch (e.KeyCode)
{
case (Keys.Left):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.Right):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.E):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.W):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.P):
{
CallRelatedMethod(this, e);
break;
}
default:
break;
}
}
}
Test Notes:
Other keys "W, E, P" triggers the Keydown event without any problems.
When Left or Right key is pressed for the second time Keydown event is triggered.
Could not find similar problems in google or here so probably I am missing a simple point but I cannot see.
Any help is appreciated.
Thank you,
|
|
|
|
|
Maybe you should write in FormKeyDown event or if you can try to catch windows keypresses.
|
|
|
|
|
i modify your code to :
if (e.Control || e.Alt || e.Shift) return;
switch (e.KeyCode)
{
case (Keys.Left):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.Right):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.E):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.W):
{
CallRelatedMethod(this, e);
break;
}
case (Keys.P):
{
CallRelatedMethod(this, e);
break;
}
default:
break;
}
hope it help
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
Thank you for your time guys,
With your approach to the method here are some more details:
- I have assigned this method to every control that can have focus. (I have only a toolbar and a form thats all.)
(Subscribed to form, toolbar keyDown events.)
- dhaim, thank you for your modification but unfortunately I dont have a problem as the code does not run in the if() statement. When I debug the code and insert a break to the beginning of the method, I saw that the Keydown event is not triggered when I first press left or right button. Which means the method is never executed although a keydown event occurs.
Thank you again, for your precious time.
|
|
|
|
|
some controls takes the control when you focused. you must lostfocus before catch the keypress.
like webBrowser, datagridview.
You must override theirs events..
|
|
|
|
|
I have tested your suggestion and I am pretty sure that main form has the focus when the program is first executed and left/right arrow is pressed as a shortcut.
Thank you,
|
|
|
|
|
yes sir, I found your problem
use FormKeyUp event. It works for all.
also here is a simple sample.
private void frmMain_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyValue == 114)
SendKeys.Send("^{TAB}");
if (e.KeyValue == 115)
SendKeys.Send("^+{TAB}");
}
|
|
|
|