Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
E

ekynox

@ekynox
About
Posts
174
Topics
31
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SMTP Exception Handling
    E ekynox

    Maybe this person is writing in this manner intentionally just to annoy a few people on these forums. Is this the current standard communication of software developers this day in age ? :mad: How hard is it to display an exception ? try { SendEmails() } catch(Exception e) { MessageBox.Show(e.Message); //or Console.WriteLine(e.Message); // or System.Diagnostics.Debug.WriteLine(e.Message); } You might want to catch specific exceptions first before handling a generic exception.

    C# help

  • confusion over asynchronous methods inside web service
    E ekynox

    Hi there, Thanks for the response. I actually worked out why I was not seeing the BeginXXX/EndXXX methods. When I complied the code under VS 2005, the compiler will automatically generate the BeginXXX/EndXXX methods of each web method found in your webservice. However, if you use VS 2008 .NET3.5 based web service the BeginXXX/EndXXX methods for each web method is not generated even if you explicitly state your BeginXXX/EndXXX methods it still wont be shown under VS 2008 .NET3.5. It would be interesting to findout why under VS 2008 and .NET 3.5 does this happen. In order to work around this I have decided not to bother with PageAsyncTask and just use the Async version of my web method. cheers

    ASP.NET csharp asp-net com help question

  • confusion over asynchronous methods inside web service
    E ekynox

    Hi there, I have been looking into implementing Asynchronous programming model within my webservice and my asp.net web form. I have found a few good MSDN articles, [^], to achieve this but there is one thing I do not quite follow. My webservice code is as listed below. I add all the relevant code including a web reference to my HelloWorldWebService in my asp.net web form to utilise PageAsyncTask functionality. One thing I have noticed is that when I create an instance of the HelloWorldWebService web service, it does not display the BeginHelloWorldProcedure and EndHelloWorldProcedure methods and the only asynchronous method HelloWorldProcedureAsync is displayed My questions are: 1) why am not seeing BeginHelloWorldProcedure and EndHelloWorldProcedure methods ? 2)If I am supposed to use HelloWorldProcedureAsync method how does this supply the IAsyncResult which is the output of BeginEventHandlder part of the input of PageAsyncTask Any help will be appreciated. thanks. [WebService] public class HelloWorldWebService : System.Web.Services.WebService { public delegate string HelloWorldAsyncStub(); public string HelloWorldProcedure() { return "HelloWorld"; } public class MyState { public object previousState; public HelloWorldAsyncStub helloworldStubStub; } [System.Web.Services.WebMethod] public IAsyncResult BeginHelloWorldProcedure(AsyncCallback cb, object s) { HelloWorldAsyncStub stub = new HelloWorldAsyncStub(HelloWorldProcedure); MyState ms = new MyState(); ms.previousState = s; ms.helloworldStubStub = stub; return stub.BeginInvoke(cb, ms); } [System.Web.Services.WebMethod] public string EndHelloWorldProcedure(IAsyncResult call) { MyState ms = (MyState)call.AsyncState; return ms.helloworldStubStub.EndInvoke(call); } }

    ASP.NET csharp asp-net com help question

  • [Message Deleted]
    E ekynox

    try this. I got the code snippet from the code generator itself. However, makesure you know which Win32_Process.Handle you want t10execute GetOwner on. In the code snippet its tied to 1076. using System; using System.Management; using System.Windows.Forms; namespace WMISample { public class CallWMIMethod { public static void Main() { try { ManagementObject classInstance = new ManagementObject("root\\CIMV2", "Win32_Process.Handle='1076'", null); // no method in-parameters to define // Execute the method and obtain the return values. ManagementBaseObject outParams = classInstance.InvokeMethod("GetOwner", null, null); // List outParams Console.WriteLine("Out parameters:"); Console.WriteLine("Domain: " + outParams["Domain"]); Console.WriteLine("ReturnValue: " + outParams["ReturnValue"]); Console.WriteLine("User: " + outParams["User"]); } catch(ManagementException err) { MessageBox.Show("An error occurred while trying to execute the WMI method: " + err.Message); } } } }

    C#

  • [Message Deleted]
    E ekynox

    you can try using the WMI C# code generator, refer to link: http://veeralp.blogspot.com/2007/11/wmi-code-generation-for-c-vbnetvb.html[^] WMI is not that hard to learn, there is alot of information available on MSDN. If you have any more problems post back.

    C#

  • Any mapping tool for NHibernate ?
    E ekynox

    If you want to build your app using a roboust framework that does automatic codegeneration of your data layer then NHibernate is a good choice. One of the frameworks I'm looking at is spring framework that uses NHibernate to generate all the data access layer as well as generating code based on proven design patterns for your application. http://www.springframework.net/[^] The other ORM tools are : LLBLGen http://www.llblgen.com/defaultgeneric.aspx[^] .NetTiershttp://nettiers.com/[^] CSLA http://www.lhotka.net/cslanet/[^]

    C# database com xml question

  • some question about VS2008
    E ekynox

    Well VS2008 RTM was released few weeks ago. Further 3.5 is not in beta, you can get production version of the framework. With VS 2008 you can target multiple .net framework versions i.e. 2.0,3.0,3.5. I cant answer question 2. As for question 3, if you find VS 2008 runs slower than VS 2008 on your PC, buy more RAM.

    C# question beta-testing help

  • File (XmlDocument) Encryption / Decryption improvements
    E ekynox

    G'day, A little while back I ran into a similar problem of storing data in a XML file which needs to be encrypted/decrypted as required. I found that using the Cryptography Application Block from Enterprise Library very useful. Purely because I could generate the symmetric key file specific to the user's credential's or machine config. Also you need to consider what happens to the encrypted/decrypted data memory once you have finished with it as well. I can post some code if you are unfamiliar with the Cryptography Application Block. To lock a file during Read/Write there is a class within .net that allows you do it. It escapes my mind right now. cheers, V

    C# question algorithms data-structures security xml

  • calling javascript from c#
    E ekynox

    A hidden field can be something similar to the input element as suggested in the example below ? <script runat="server"> public void Page_Load(Object sender, EventArgs e) { // Define the name and type of the client scripts on the page. String csname2 = "ButtonClickScript"; Type cstype = this.GetType(); // Get a ClientScriptManager reference from the Page class. ClientScriptManager cs = Page.ClientScript; // Check to see if the client script is already registered. if (!cs.IsClientScriptBlockRegistered(cstype, csname2)) { StringBuilder cstext2 = new StringBuilder(); cstext2.Append("<script type=\"text/javascript\"> function DoClick() {"); cstext2.Append("var oElement = document.all.Panel1; Form1.Message.value= oElement.offsetLeft;} </"); cstext2.Append("script>"); cs.RegisterClientScriptBlock(cstype, csname2, cstext2.ToString(), false); } } </script> <html > <head> <title>ClientScriptManager Example</title> </head> <body> <form id="Form1" runat="server"> <input type="text" id="Message" /> <input type="button" value="ClickMe" onclick="DoClick()" /> <asp:Panel ID="Panel1" runat="server" style="position:absolute;top: 375px;left: 628px;height: 422px;width: 513px; border-color:Red;border-width:thick;border-style:solid"></asp:Panel> </form> </body> </html> edit: Example is based from MSDN article http://msdn2.microsoft.com/en-us/library/z9h4dk8y.aspx[[^](http://msdn2.microsoft.com<br mode= "New Window")] edit: sorry I worked out what a hidden field is thanks to google http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlinputhidden(VS.71).aspx[^]

    modified on Thursday, December 06, 2007 8:33:21 AM

    ASP.NET help csharp javascript tools question

  • calling javascript from c#
    E ekynox

    jagadeeshkumar2106 wrote:

    Page.ClientScript.RegisterStartupScript(me.GetType(), "dummyKey", "function name()", true);

    thanks for posting however i still dont get this ClientScript.RegisterStartupScript method. If my javascript is return a value how does this get handled in ClientScript.RegisterStartupScript ?

    ASP.NET help csharp javascript tools question

  • calling javascript from c#
    E ekynox

    hi guys, I am stuck on the issue of being able to call a javascrip function from my c# code. This is my javascript: <SCRIPT LANGUAGE="JScript"> function showPosition() { var oElement = document.all.resultPanel; return oElement.offsetLeft; } </SCRIPT> The javascript itself works fine, the problem comes down to how do I call my javascript in c#. This was my attempt: private void CallJavascript() { string popupScript = "<SCRIPT LANGUAGE='JScript'>" + "function showPosition(){ var oElement = document.all.resultPanel; return oElement.offsetLeft;}</SCRIPT>"; Page.RegisterStartupScript("PopupScript", popupScript); Label1.Text = popupScript.ToString(); //this is wrong } Can someone please help me correct the CallJavascript() method. thanks

    ASP.NET help csharp javascript tools question

  • extremely strange ado.net issue
    E ekynox

    LOL Colin that's one funny pointer. I managed to work out my problem, it was do with timing issue. By the time MethodA finishes executing, I believe access has not had time to update Table A, then MethodB starts executing and Table A is missing the relavant data and MethodB fails to insert a row in Table B. Why does it work in debug mode well when debugging there is ample time for Access to actually commit the data into the table. Solution was to a a Thread.Sleep() to cause pause and it all works. Yes you are right about placing tracing code. public void AddStuffToDB() { MethodA(string x,string y); MethodB(string x); }

    Database database help csharp asp-net question

  • extremely strange ado.net issue
    E ekynox

    G'day folks, I have been experiencing an extremely strange problem in my code, this has to be marked as a X-File episode. I have a method in my class which executes two other methods. One method(Method A) inserts a row in table A and the other (Method B) inserts a row in table B. This is part of an asp.net application. When I run the the asp.net application without debugging both methods (A and B) execute fine, however method B doesnt seem to be updating table B whereas Method A updates Table A just fine. I ran my query through MS Access with test data and the table got updated. Then I decided to step through the code and again method B seems to be updating table B. I run the application again without debugging and samething happens Table B doesnt get updated and Table A is getting updated. For the life of me I cant seem to point my finger where the problem is residing. Can this be a connectivity issue with MS Access and my asp.net application ? Both the asp.net and access database are residing in my development environment. Any pointers will be appreciated. thanks

    Database database help csharp asp-net question

  • StrongNameIdentityPermission - SNIP
    E ekynox

    I came across this little unknown facet of .net a few days ago and today I decided to build a sample application to test this out. I followed the instructions as to how to apply SNIP specified on this site: http://www.morganskinner.com/Articles/StrongNameIdentityPermission/[^] When I called my assembly in an unsigned project, it failed to give me any warning and my method from my signed class library executed. Is this is happening because the signed class library is running in full trusted zone ?

    C# csharp com tutorial question

  • AddPrinterConnection failing to add network printer
    E ekynox

    It seems that AddPrinterConnection method is reserved for adding network printers to local machines rather than remote machines as to what I was trying to achieve. To add network printer on remote machines you need to use rundll32 printui.dll,PrintUIEntry /?. This is a command line method of doing things however it can be easily incorporated into managed code.

    C# sysadmin workspace csharp visual-studio com

  • How to connect to network printer via C#
    E ekynox

    anychance you can explain how you managed to add a printer connection to a remote computer ?

    C# tutorial question csharp sysadmin

  • AddPrinterConnection failing to add network printer
    E ekynox

    Hi guys, have been playing with WMI to add a network printer connection to a Windows XP pc. My environment consists of a server running Windows Server 2003 and Visual Studio 2005 and a test pc running windows xp. Further, I have setup a full domain controller environment. I have managed to write the code to add the network printer and it works fine when installing the printer on the same machine the code is executing from i.e the server or xp pc. However, if I run the code from the server to install the network printer onto the test pc, it does not work. An exception is generated stating "Not Supported, the inner exception is blank. I can manually install the network printer on the test pc via the control panel, proving that the connectivity between machines is fine. The exception occurs when the mgtClass.InvokeMethod is executed. 1) If I specifiy the ip address of the test pc in the ManagementScope object does and when an object of Management class is instantiated does this imply that the network printer will be added to the test pc? 2)Using the AddPrinterConnection method from the WIN32_PRINTER class, is this the only way to add a network printer ? 3) To install the network printer on the server itself, omit the IP address,ipAddressOfClientPC, of the server from the ManagementScope object and it installs fine, provided the code itself is running of the server. So this leads me to believe its an issue with ManagementScope. However, if installing on the same machine as the code is running on then the username and password need not to be defined. So what do I need to do to the Management Scope object to make it work? I used the WMI code generated by the WMI Code Generator, http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e, I have added my code below. If somone can point me in the right direction as to the mistake I am making, I would appreciate it. thanks V using System; using System.Management; using System.Runtime.InteropServices; using System.Text; namespace SampleApp { public class AddPrinterConnection { public static void Main() { //only required if required to access another machine with different username and password string username = "administrator"; string password = "password"; string ipAddressOfClientPC = "192.168.0.22"; ManagementScope scope = new ManagementScope("\\\\" + ipAddressOfClientPC + "\\root\\cimv2");

    C# sysadmin workspace csharp visual-studio com

  • School Project Deadline
    E ekynox

    hi there, Try mathtools, full of useful code snippets, very handy while I was at uni. It really surprises me as to why lecturers expect students to develop signal/image processing code for a 3 week project in c++ when Matlab is a much easier alternative. hope this helps

    C# question c++ com security help

  • Design Patterns
    E ekynox

    hi there, if you look at the last line of code you wrote, the word Factory suggests he is using software factories. Software factories is a bit vague as you can use different patterns to implement it, i,e Abstract Pattern. If you want to learn more than download the Microsoft .NET PetShop application and see how its software factories are implemented. http://msdn2.microsoft.com/en-us/library/aa479071.aspx[^] The other resource you can try is: http://www.dofactory.com/Default.aspx[^] Hope this helps.

    Design and Architecture database design business

  • Bluetooth code sample C# or java
    E ekynox

    You can use WMI to detect devices detected by your dongle. Try this article, even though its in VB code seems pretty easy to port to c# http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct07/hey1018.mspx[^]

    C# csharp java algorithms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups