Thursday, January 21, 2010

IMAP component C# dot net

You can use a IMAP component to implement this. As explained here 
http://www.codeproject.com/Messages/2504247/Re-Move-a-message-into-a-folder.aspx

The IMAP commands to accomplish it looks something like this:

UID COPY messageUID "new folder"
UID STORE messageUID +FLAGS (\Deleted)
EXPUNGE


Some popular IMAP components are:

Below one i am using for my development.

Download 3 rd party component from
http://www.lesnikowski.com/mail/
it will be download as .exe . Click to install to a specific directory . Latter add mail.dll in reference by browsing to installed lib directory .

Document is available here
http://www.lesnikowski.com/mail/documentation/




Friday, September 4, 2009

How can I use AJAX.NET 1.0 - System.Web.Extensions, Version=1.0.61025.0

How can I use AJAX.NET 1.0 - System.Web.Extensions, Version=1.0.61025.0

 

If you got this message: "Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

1. You must copy dll(s) to Bin folder:

AjaxControlToolkit.dll
System.Web.Extensions.dll v1.0.61025.0 or other
System.Web.Extensions.Design.dll v1.0.61025.0

and maybe

AJAXExtensionsToolbox.dll v1.0.61025.0

You may have add those tags and sections to the web.config:

2. Under the <Configuration> tag, add the following <configSections> sections:

Code:

    <configSections>
      <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
         <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"  allowDefinition="MachineToApplication"/>
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
               <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
               <section name="profileService"  type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"  allowDefinition="MachineToApplication"/>
               <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
            </sectionGroup>
         </sectionGroup>
      </sectionGroup>
   </configSections>



3. Under the <system.web> tag, add the following <pages> sections:

Code:

   <pages>
      <controls>
         <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </controls>
   </pages>



3. Under <compilation>, <httpHandlers> and <httpModules> tags:

Code:

    <compilation debug="true">
      <assemblies>
         <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
         <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
         <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
   </compilation>
   <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
   </httpHandlers>
   <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   </httpModules>



5. Under <Configuration> tag, add the following <system.web.extensions> and <system.webServer> sections:

Code:

   <system.web.extensions>
      <scripting>
         <webServices>

            <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->   
            <!-- <jsonSerialization maxJsonLength="500"> -->
            <!--    <converters> -->
            <!--       <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>  -->
            <!--    </converters>  -->
            <!-- </jsonSerialization>  -->


            <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
             <!-- <authenticationService enabled="true" requireSSL = "true|false"/> -->

            <!-- Uncomment the lines below to enable the profile service.  To allow profile properties to be retrieved -->
            <!-- ...and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and -->
            <!-- ...writeAccessProperties attributes -->
            <!-- <profileService enabled="true" readAccessProperties="propertyname1,propertyname2" writeAccessProperties="propname1,propname2"/> -->

         </webServices>
         <!-- <scriptResourceHandler enableCompression="true" enableCaching="true" />  -->
      </scripting>
   </system.web.extensions>
   <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
         <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </modules>
      <handlers>
         <remove name="WebServiceHandlerFactory-Integrated"/>
         <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </handlers>
   </system.webServer>



You can read: Add AJAX to an Existing Web Application

6. On IIS7 you must fix web.config with migrate tool or migrate web.confing to Integrated pipeline mode:

6.1 You must migrate the application configuration to work properly in Integrated mode. You can migrate the application configuration with AppCmd:

Code:

> %windir%\system32\inetsrv\Appcmd migrate config "<ApplicationPath>"



6.2 You can migrate manually by moving the custom entries in in the <system.web>/<httpModules> and <system.web>/<httpHandlers> configuration manually to the <system.webServer>/<handlers> and <system.webServer>/<modules> configuration sections, and either removing the <httpHandlers> and <httpModules> configuration OR adding the following to your application’s web.config:

Code:

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>



6.3 Use Classic mode as a last resort if you cannot apply the specified workaround.

Moving to Classic mode will make your application unable to take advantage of ASP.NET improvements made possible in Integrated mode, leveraging future features from both Microsoft and third parties that may require the Integrated mode.

You can read: Breaking Changes for ASP.NET 2.0 applications running in Integrated mode on IIS 7.0

 

Thursday, August 20, 2009

What is Virtual Memory?

 

What is Virtual Memory?

Virtual memory is simulated RAM. When you have used up all your RAM, your computer will shift data to an empty space on the hard drive. The computer swaps data to the hard disk and back to your RAM as needed. When you increase your virtual memory you are increasing the empty space that is reserved for your RAM overflow.

Also having enough available space is absolutely necessary for your virtual memory and RAM to function properly. You can increase Virtual Memory performance automatically by freeing up resources in your registry. You may want to use a Registry Cleaner. Click Here to learn more!

How to increase Virtual Memory?

In Windows XP

1.Click Start, and then click Control Panel.
2.Click Performance and Maintenance, and then click System.
3.On the Advanced tab, under Performance, click Settings.
4.On the Advanced tab, under Virtual memory, click Change.
5.Under Drive [Volume Label], click the drive that contains the paging file that you want to change.
6.Under Paging file size for selected drive, click to Custom size check box. You can enter the amount of memory you would like to reserve for Virtual memory by entering the initial and maximum size.
7.Click Set
When you are prompted to restart the computer, click Yes.
Special Note: You should choose the same amount for the initial size and maximum size. This will Stop your CPU from constantly changing the paging file.

HOT TIP: To stop your CPU from constantly changing the paging file, set the initial and maximum size to the same value. For example, 500 and 500. The value should be at least 1.5 times more than your physical RAM. If your computer has 512MB of RAM increase the virtual memory paging file to 1.5*512= 768

In Vista

1. Click Start button Picture of the Start button
2. Click Control Panel
3. Choose System and Maintenance and then click System.
4. In the left pane, click Advanced system settings.
5.On the Advanced tab, under Performance, click Settings.
6. Click the Advanced tab, and then, under Virtual memory, choose Change.
7. Click Custom to change the Initial size (MB) and Maximum size. See the hot tip above.

 

Tuesday, August 18, 2009

Sql Commands [usefull For Injection]

 

ABORT                                      -- abort the current transaction
ALTER DATABASE                      -- change a database
ALTER GROUP                          -- add users to a group or remove users from a group
ALTER TABLE                            -- change the definition of a table
ALTER TRIGGER                        -- change the definition of a trigger
ALTER USER                             -- change a database user account
ANALYZE                                  -- collect statistics about a database
BEGIN                                      -- start a transaction block
CHECKPOINT                             -- force a transaction log checkpoint
CLOSE                                      -- close a cursor
CLUSTER                                  -- cluster a table according to an index
COMMENT                                 -- define or change the comment of an object
COMMIT                                    -- commit the current transaction
COPY                                        -- copy data between files and tables
CREATE AGGREGATE                 -- define a new aggregate function
CREATE CAST                            -- define a user-defined cast
CREATE CONSTRAINT TRIGGER -- define a new constraint trigger
CREATE CONVERSION               -- define a user-defined conversion
CREATE DATABASE                   -- create a new database
CREATE DOMAIN                       -- define a new domain
CREATE FUNCTION                    -- define a new function
CREATE GROUP                         -- define a new user group
CREATE INDEX                          -- define a new index
CREATE LANGUAGE                   -- define a new procedural language

 

CREATE OPERATOR                   -- define a new operator
CREATE OPERATOR CLASS         -- define a new operator class for indexes
CREATE RULE                           -- define a new rewrite rule
CREATE SCHEMA                       -- define a new schema
CREATE SEQUENCE                   -- define a new sequence generator
CREATE TABLE                          -- define a new table
CREATE TABLE AS                     -- create a new table from the results of a query
CREATE TRIGGER                      -- define a new trigger
CREATE TYPE                            -- define a new data type
CREATE USER                           -- define a new database user account
CREATE VIEW                           -- define a new view
DEALLOCATE                            -- remove a prepared query
DECLARE                                  -- define a cursor
DELETE                                    -- delete rows of a table
DROP AGGREGATE                    -- remove a user-defined aggregate function
DROP CAST                               -- remove a user-defined cast
DROP CONVERSION                   -- remove a user-defined conversion
DROP DATABASE                       -- remove a database
DROP DOMAIN                          -- remove a user-defined domain
DROP FUNCTION                       -- remove a user-defined function
DROP GROUP                            -- remove a user group
DROP INDEX                             -- remove an index
DROP LANGUAGE                      -- remove a user-

 

 

DROP TYPE                                -- remove a user-defined data type
DROP USER                               -- remove a database user account
DROP VIEW                               -- remove a view
END                                          -- commit the current transaction
EXECUTE                                  -- execute a prepared query
EXPLAIN                                   -- show the execution plan of a statement
FETCH                                      -- retrieve rows from a table using a cursor
GRANT                                      -- define access privileges
INSERT                                     -- create new rows in a table
LISTEN                                     -- listen for a notification
LOAD                                        -- load or reload a shared library file
LOCK                                        -- explicitly lock a table
MOVE                                       -- position a cursor on a specified row of a table
NOTIFY                                     -- generate a notification
PREPARE                                   -- create a prepared query
REINDEX                                  -- rebuild corrupted indexes
RESET                                      -- restore the value of a run-time parameter to a default value
REVOKE                                    -- remove access privileges
ROLLBACK                                -- abort the current transaction
SELECT                                     -- retrieve rows from a table or view
SELECT INTO                            -- create a new table from the results of a query
SET                                          -- change a run-time parameter
SET CONSTRAINTS                    -- set the constraint mode of the current transaction
SET SESSION AUTHORIZATION -- set the session user identifier and the current user identifier of the current session
SET TRANSACTION                    -- set the characteristics of the current transaction
SHOW                                       -- show the value of a run-time parameter
START TRANSACTION                -- start a transaction block
TRUNCATE                                -- empty a table
UNLISTEN                                 -- stop listening for a notification
UPDATE                                    -- update rows of a table
VACUUM                                   -- garbage-collect and optionally analyze a database

 

 

Thursday, July 23, 2009

TRIGGER - After / Before / deleted / inserted - MS SQL

 

TRIGGER

            There are

                        BEFORE (trigger)

                        AFTER (trigger)

 

In BEFORE Trigger .

            There is no keyword in MS sql. Instead it defines for.

It is a default trigger

 

In AFTER Trigger.

            There is a keyword in MS sql.i,e After.

 

 

We can get rows which are stored in temporary table by trigger.

            Insert / update

                        Get values from inserted. ( select * from inserted) (copy of a row(s) effected).

            Delete

                        Get values from deleted .  ( select * from deleted) (copy of a row(s) effected).

 

 

During UPDATE

            On Before trigger – we can get row which is not effected by a update in deleted table.

                                                Basically we get rows from deleted table when we are maintaining log/history table.

 

            On After trigger – we can get row which is effected by a update in inserted table.

 

 

Note : there is no updated temporary table.

 

Friday, July 3, 2009

Service Unavailable


Service Unavailable

Then the first solution to the above error is http://support.microsoft.com/default.aspx?id=823552 but if this does not solve the problem try doing the following stuff.

Open the IIS Manager, right click Web Sites and select properties:

http://www.go4expert.com/images/PostImages/IISMan.jpg

Switch to the Service Tab

http://www.go4expert.com/images/PostImages/WebProp.jpg

Check "Run WWW Service in IIS 5.0 Isolation Mode".

You will be asked for Restart of IIS. Click yes to restart IIS. If you are not asked just restart IIS.




This message (including any attachments) contains confidential information intended for a specific individual and purpose and is protected by law. If you are not the intended recipient, you should delete this Message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.



Code Formater

Paste Here Your Source Code
Source Code Formatting Options
1) Convert Tab into Space :
2) Need Line Code Numbering :
3) Remove blank lines :
4) Embeded styles / Stylesheet :
5) Code Block Width :
6) Code Block Height :
7) Alternative Background :
Copy Formatted Source Code
 
Preview Of Formatted Code