Search Results

Search found 369 results on 15 pages for 'codeproject'.

Page 5/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • format ugly c# source code

    - by Fred F.
    I found a C# game http://www.codeproject.com/KB/game/BattleField.aspx that does what I need to learn. The source code is not formatted good and hard to follow. I used visual studios format document, but the format is still bad. How do I reformat the source code to make it easer to read?

    Read the article

  • Simple thread-safe non-blocking file logger class in c#

    - by Jason Renlan
    I have a web application, that will log some information to a file. I am looking for a simple thread-safe non-blocking file logger class in c#. I have little experience with threading. I known there are great logging components out there like log4Net, Enterprise Library Logging Block, ELMAH, but I do not want an external dependence for my application. I was thinking about using this queue implementation http://www.codeproject.com/KB/cpp/lockfreeq.aspx

    Read the article

  • Treeview inside DropDown in ASP.NET

    - by Pravin Kumar
    I have a hierarchial data ( like Geography -- Area- Country - State ) which need to be shown in a Treeview. This was done but the problem is it is occupying toooo much space on the web page. So i thought of using a drop down that would hold a treeview ??? Got few samples from CodeProject with No success. Any pointers or any other suggestion to solve my issue would be much appreciated :) Thank you :P

    Read the article

  • [WCF] Cannot find the X.509 certificate after publishing

    - by Tr?n Qu?c Bình
    Hi everybody, I am building a WCF service as http://www.codeproject.com/KB/WCF/9StepsWCF.aspx#Beginner%20WCF%20FAQ%E2%80%99s and facing a trouble with X.509 certificate: when I debug, evething is OK. But when I pubish it to IIS (5.1, windowsXP SP3) I receive the error: **Cannot find the X.509 certificate using the following search criteria: StoreName 'My', StoreLocation 'CurrentUser', FindType 'FindBySubjectName', FindValue 'WCFServer'.** Thanks for any idea.

    Read the article

  • Rich Text Editing in Windows Forms

    - by fawad
    I am using following text editor for my windows forms application http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx This works great and a wonderful control, however I am trying to accomplish one task i.e. I wanted to insert a custom tag to the underlying html for eg if user clicks on a button on form I want to insert a tag <myTag>value</myTag>" at the cursor's position of text editor. Can anyone guide me how to achieve this?

    Read the article

  • c# Windows Service not appearing in services list after install

    - by alex
    I've created a windows service in c#, using Visual Studio 2008 I pretty much followed this: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx I created a setup project, as instructed to in the article, and ran it... it installs my service to c:\program files\product etc.... however, it does not then appear in the services list.. What am i missing?

    Read the article

  • How to show printer properties/preferences dialog?

    - by Patrick Klug
    I can't figure out how to properly show the printer preference dialog of a given printer so that the user can change the printer settings. Most of the examples that I can find online manage to show the dialog but any changes the user might make are lost which makes it useless. Example: http://www.codeproject.com/KB/system/PrinterPropertiesWindow.aspx (I tried to change the code as suggested by BartJoy but that didn't fix it) Does anyone know how to do this properly?

    Read the article

  • TreeView Controls - HTREEVIEW

    - by nXqd
    I'm new to win32 API programming and I try to understand source code of treeview from codeproject. But I really don't understand this : BOOL TreeView::DoNotify(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // blah blah HTREEVIEW Selected = (HTREEITEM)SendDlgItemMessage(hWnd,ID_TREE,TVM_GETNEXTITEM,TVGN_CARET,(LPARAM)Selected); // halb halb } It doesn't work ( Selected is used without initializing) until I declare Selected as global variable. Thanks for reading this and I need your help .

    Read the article

  • Getting GPU clock speeds with SetupDiEnumDeviceInfo

    - by user157078
    Hi everyone! I posted a question earlier regarding obtaining GPU clock speeds, but I guess the thread appeared as already answered since someone had replied to it. I'd been advised by one of your members to try extracting GPU clock speeds using SetupDiEnumDeviceInfo. However, I looked around at some examples, like this one: http://www.codeproject.com/KB/system/DevMgr.aspx and nothing seemed to be displayed about the clock speed. Could someone please elaborate on how to achieve this, if at all possible? Thanks again

    Read the article

  • GenericIdentity not FormsIdentity

    - by Tony
    H Regarding this URL http://www.codeproject.com/KB/aspnet/FlashUpload.aspx User.Identity as System.Web.Security.FormsIdentity is always null, because the Identity is GenericIdentity, I assumed it will be as in the tutorial FormsIdentity, what is chances. Thanks

    Read the article

  • Why use Soap as authenitcation in webservice?

    - by chobo2
    Hi I am looking at this tutorial http://www.codeproject.com/KB/cpp/authforwebservices.aspx and I am wondering what the reason for using authentication through soap is? Like why not just pass the username and password through the parameters instead? Is it more secure to do it like the way the guy is in the tutorial verus just using passing it through as parameters? Thanks

    Read the article

  • Generating dynamic thumbnail of a PDF for ASP.NET

    - by Anjisan
    I've used a tool from Aspose (Aspose.PDF.kit) to generate a JPG thumbnail on the fly of a PDF for a .NET application. This works great, but what kind of other alternatives are there? Codeproject.com has this tutorial, but it requires you to have the full version of Acrobat. Is there an open source alternative that's geared for ASP.NET?

    Read the article

  • How to turn on monitor after wake-up from suspend mode?

    - by alek.sys
    Hi all, I need wake up PC from sleep to perform some actions - from C#. I've used CreateWaitableTimer functions, everything goes fine, at given time PC wakes up - but monitor stays in power save mode (turned off). So i want to know - how possible to turn on monitor after wake up? PS I've tried "Complete Guide on How To Turn A Monitor On/Off/Standby" - with SendMessage (Codeproject) and SetThreadExecutionState(ES_DISPLAY_REQUIRED) - it doesn't work Any ideas?

    Read the article

  • send sms in asp.net by gsm modem

    - by danar jabbar
    I devloped an asp.net application to send sms from gsm modem to destination base on URL from the browser I used a library that developed by codeproject http://www.codeproject.com/articles/20420/how-to-send-and-receive-sms-using-gsm-modem but I get problem when I request form two browsers at same time and I want to make the my code detect that the modem is use by another process at the time here is my code: DeviceConnection deviceConnection = new DeviceConnection(); protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["destination"] != null && Request.QueryString["text"] != null) { deviceConnection.setBaudRate(9600); deviceConnection.setPort(12); deviceConnection.setTimeout(200); SendSms sendSms = new SendSms(deviceConnection); if (deviceConnection.getConnectionStatus()) { sendSms.strReciverNo = Request.QueryString["destination"]; sendSms.strTextMessage = Request.QueryString["text"]; if (sendSms.sendSms()) { Response.Write("Mesage successfuly sent to " + Request.QueryString["destination"]); } else { Response.Write("Message was not sent"); } } } } catch (Exception ex) { Console.WriteLine("Index "+ex.StackTrace); } } This is SendSms class: class SendSms { DeviceConnection deviceConnection; public SendSms(DeviceConnection deviceConnection) { this.deviceConnection = deviceConnection; } private string reciverNo; private string textMessage; private delegate void SetTextCallback(string text); public string strReciverNo { set { this.reciverNo = value; } get { return this.reciverNo; } } public string strTextMessage { set { this.textMessage = value; } get { return this.textMessage; } } public bool sendSms() { try { CommSetting.Comm_Port = deviceConnection.getPort();//GsmCommMain.DefaultPortNumber; CommSetting.Comm_BaudRate = deviceConnection.getBaudRate(); CommSetting.Comm_TimeOut = deviceConnection.getTimeout();//GsmCommMain.DefaultTimeout; CommSetting.comm = new GsmCommMain(deviceConnection.getPort() , deviceConnection.getBaudRate(), deviceConnection.getTimeout()); // CommSetting.comm.PhoneConnected += new EventHandler(comm_PhoneConnected); if (!CommSetting.comm.IsOpen()) { CommSetting.comm.Open(); } SmsSubmitPdu smsSubmitPdu = new SmsSubmitPdu(strTextMessage, strReciverNo, ""); smsSubmitPdu.RequestStatusReport = true; CommSetting.comm.SendMessage(smsSubmitPdu); CommSetting.comm.Close(); return true; } catch (Exception exception) { Console.WriteLine("sendSms " + exception.StackTrace); CommSetting.comm.Close(); return false; } } public void recive(object sender, EventArgs e) { Console.WriteLine("Message received successfuly"); } } }

    Read the article

  • C++/CLI HTTP Proxy problems...

    - by darkantimatter
    Hi, I'm trying(very hard) to make a small HTTP Proxy server which I can use to save all communications to a file. Seeing as I dont really have any experience in the area, I used a class from codeproject.com and some associated code to get started (It was made in the old CLI syntax, so I converted it). I couldn't get it working, so I added lots more code to make it work (threads etc), and now it sort of works. Basically, it recieves something from a client (I just configured Mozilla Firefox to route its connections through this proxy) and then routes it to google.com. After it sends Mozilla's data to google, recieves a responce, and sends that to Mozilla. This works fine, but then the proxy fails to recieve any data from Mozilla. It just loops in the Sleep(50) section. Anyway, heres the code: ProxyTest.cpp: #include "stdafx.h" #include "windows.h" #include "CHTTPProxy.h" public ref class ClientThread { public: System::Net::Sockets::TcpClient ^ pClient; CHttpProxy ^ pProxy; System::Int32 ^ pRecieveBufferSize; System::Threading::Thread ^ Thread; ClientThread(System::Net::Sockets::TcpClient ^ sClient, CHttpProxy ^ sProxy, System::Int32 ^ sRecieveBufferSize) { pClient = sClient; pProxy = sProxy; pRecieveBufferSize = sRecieveBufferSize; }; void StartReading() { Thread = gcnew System::Threading::Thread(gcnew System::Threading::ThreadStart(this,&ClientThread::ThreadEntryPoint)); Thread->Start(); }; void ThreadEntryPoint() { char * bytess; bytess = new char[(int)pRecieveBufferSize]; memset(bytess, 0, (int)pRecieveBufferSize); array<unsigned char> ^ bytes = gcnew array<unsigned char>((int)pRecieveBufferSize); array<unsigned char> ^ sendbytes; do { if (pClient->GetStream()->DataAvailable) { try { do { Sleep(100); //Lets wait for whole packet to get cached (If it even does...) unsigned int k = pClient->GetStream()->Read(bytes, 0, (int)pRecieveBufferSize); //Read it for(unsigned int i=0; i<(int)pRecieveBufferSize; i++) bytess[i] = bytes[i]; Console::WriteLine("Packet Received:\n"+gcnew System::String(bytess)); pProxy->SendToServer(bytes,pClient->GetStream()); //Now send it to google! pClient->GetStream()->Flush(); } while(pClient->GetStream()->DataAvailable); } catch (Exception ^ e) { break; } } else { Sleep(50); //It just loops here because it thinks mozilla isnt sending anything if (!(pClient->Connected)) break; }; } while (pClient->GetStream()->CanRead); delete [] bytess; pClient->Close(); }; }; int main(array<System::String ^> ^args) { System::Collections::Generic::Stack<ClientThread ^> ^ Clients = gcnew System::Collections::Generic::Stack<ClientThread ^>(); System::Net::Sockets::TcpListener ^ pTcpListener = gcnew System::Net::Sockets::TcpListener(8080); pTcpListener->Start(); System::Net::Sockets::TcpClient ^ pTcpClient; while (1) { pTcpClient = pTcpListener->AcceptTcpClient(); //Wait for client ClientThread ^ Client = gcnew ClientThread(pTcpClient, gcnew CHttpProxy("www.google.com.au", 80), pTcpClient->ReceiveBufferSize); //Make a new object for this client Client->StartReading(); //Start the thread Clients->Push(Client); //Add it to the list }; pTcpListener->Stop(); return 0; } CHTTPProxy.h, from http://www.codeproject.com/KB/IP/howtoproxy.aspx with a lot of modifications: //THIS FILE IS FROM http://www.codeproject.com/KB/IP/howtoproxy.aspx. I DID NOT MAKE THIS! BUT I HAVE MADE SEVERAL MODIFICATIONS! #using <mscorlib.dll> #using <SYSTEM.DLL> using namespace System; using System::Net::Sockets::TcpClient; using System::String; using System::Exception; using System::Net::Sockets::NetworkStream; #include <stdio.h> ref class CHttpProxy { public: CHttpProxy(System::String ^ szHost, int port); System::String ^ m_host; int m_port; void SendToServer(array<unsigned char> ^ Packet, System::Net::Sockets::NetworkStream ^ sendstr); }; CHttpProxy::CHttpProxy(System::String ^ szHost, int port) { m_host = gcnew System::String(szHost); m_port = port; } void CHttpProxy::SendToServer(array<unsigned char> ^ Packet, System::Net::Sockets::NetworkStream ^ sendstr) { TcpClient ^ tcpclnt = gcnew TcpClient(); try { tcpclnt->Connect(m_host,m_port); } catch (Exception ^ e ) { Console::WriteLine(e->ToString()); return; } // Send it if ( tcpclnt ) { NetworkStream ^ networkStream; networkStream = tcpclnt->GetStream(); int size = Packet->Length; networkStream->Write(Packet, 0, size); array<unsigned char> ^ bytes = gcnew array<unsigned char>(tcpclnt->ReceiveBufferSize); char * bytess = new char[tcpclnt->ReceiveBufferSize]; Sleep(500); //Wait for responce do { unsigned int k = networkStream->Read(bytes, 0, (int)tcpclnt->ReceiveBufferSize); //Read from google for(unsigned int i=0; i<k; i++) { bytess[i] = bytes[i]; if (bytess[i] == 0) bytess[i] = ' '; //Dont terminate the string if (bytess[i] < 8) bytess[i] = ' '; //Somethings making the computer beep, and its not 7?!?! }; Console::WriteLine("\n\nAbove packet sent to google. Google Packet Received:\n"+gcnew System::String(bytess)); sendstr->Write(bytes,0,k); //Send it to mozilla Console::WriteLine("\n\nAbove packet sent to client..."); //Sleep(1000); } while(networkStream->DataAvailable); delete [] bytess; } return; } Any help would be much appreciated, I've tried for hours.

    Read the article

  • Algorithm for sentence analysis and tokenization

    - by Andrea Nagar
    I need to analyze a document and compile statistics as to how many times each a sequence of words is used (so the analysis is not on single words but of batch of recurring words). I read that compression algorithms do something similar to what I want - creating dictionaries of blocks of text with a piece of information reporting its frequency. It should be something similar to http://www.codeproject.com/KB/recipes/Patterns.aspx Do you have anything written in C#?

    Read the article

  • Reading Email using Pop3 in C#

    - by Eldila
    I am looking for a method of reading emails using Pop3 in C# 2.0. Currently, I am using code found in CodeProject. However, this solution is less than ideal. The biggest problem is that it doesn't support emails written in unicode.

    Read the article

  • Doubleton Pattern Implementation

    - by Pierreten
    I'm leveraging the Doubleton Pattern from this link http://www.codeproject.com/KB/architecture/designpattern_doubleton.aspx in my own code. I think it makes things a lot easier since the Singleton only provides one instance, but I get two with this pattern. I was wondering if it would make sense to have it implement an interface so I can inject it into my domain layer.

    Read the article

  • Accessing web Service from jQuery - cross domain

    - by Christo Fur
    Hi I am trying to acess a wcf service from a jQuery client Specifically this example http://www.codeproject.com/KB/aspnet/WCF_JQUERY_ASMX.aspx#4 All works well when the client webpage is on the same domain as the service As soon as I move the client webpage to another domain it breaks. It cant reach the service and the request fails This happens for all the examples, ASMX, REST and WCF any ideas how to get this working cross daomain?

    Read the article

  • Splash Screen Example

    - by Kovu
    Hi, I only want a simple Splash Screen Example. Get the Code, Insert my picture, add 2 lines of code to load and finish. But all I can google is so complex, that is too much. I only want a form with a picture that goes more and more transparent until it hides automaticly and my window is shown. I tried the "prettygoodsplashscreen" from Codeproject, but don't work for me. Lang is c#.net 2.0

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >