Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Dear,
I am planning to develop a software that will have a trial version. After trialing period client should send a request for serial key. I will give this but he will not permit to edit this key. Only system can do this.
Can anyone tell me any resource or methods on how to Acsses/Read/write into the windows registry using visual c#.


Any help would be greatly appreciated.

Regards
Pritam
Posted
Updated 17-Oct-16 18:29pm
Comments
pritam40 28-Dec-14 4:51am    
BEGIN TRAN

DELETE FROM tbl_Leave_StaffCLeaveStatus WHERE SlsLvTypeID = '11'
INSERT INTO tbl_Leave_StaffCLeaveStatus(SlsPin, SlsLvTypeID, SlsEwdID,
SlsLvBalance, SlsExcessLvBalance, SetDate, UserName)
SELECT DISTINCT SlsPin,'11',SlsEwdID,0,0,SetDate, UserName FROM tbl_Leave_StaffCLeaveStatus WHERE SlsLvTypeID = '01'

Declare @PIN AS VARCHAR(8)
DECLARE CursorName CURSOR FOR
SELECT lscs.SlsPin FROM tbl_Leave_StaffCLeaveStatus lscs WHERE lscs.SlsEwdID = '2' ORDER BY lscs.SlsPin,lscs.SlsLvTypeID ASC
OPEN CursorName
FETCH FROM CursorName INTO @PIN
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE tbl_Leave_StaffCLeaveStatus SET SlsEwdID = '2' WHERE SlsPin = @PIN
FETCH FROM CursorName INTO @PIN
END
CLOSE CursorName
DEALLOCATE CursorName

SELECT * FROM tbl_Leave_StaffCLeaveStatus ORDER BY SlsPin
ROLLBACK


pritam40 25-Jan-15 9:03am    
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER OFF
GO
--exec Sp_Pay_RptStaffSalaryTransfertoBank 2014, 1, default, default, default,'',''

ALTER PROCEDURE [Sp_Pay_RptStaffSalaryTransfertoBank]
@PinYear SMALLINT ,
@PinMonth TINYINT ,
@BankID NCHAR(3) = '%' ,
@ProjectID NVARCHAR(3) = '%' ,
@AreaID NVARCHAR(4) = '%' ,
@BaseLineInfo VARCHAR(50) ,
@ProgramStatus NVARCHAR(1)
WITH ENCRYPTION
AS
DECLARE @YearMonth NVARCHAR(6)
SET Nocount ON
SET dateformat 'DMY'

CREATE TABLE #TMonthyPsHistory
(
PINID NCHAR(8) ,
SbkId NCHAR(2) ,
Amount NUMERIC(12, 2)
)

CREATE TABLE #TMonthlyPsothersHis
(
PINID NCHAR(8) ,
BasicAmount NUMERIC(12, 2) ,
OtherAmount NUMERIC(11, 2) ,
PFAmount NUMERIC(11, 2) ,
TranDeduction NUMERIC(11, 2) ,
IncomeTax NUMERIC(11, 2) ,
LoanReaAmount NUMERIC(11, 2) ,
OtherAdjAmount NUMERIC(11, 2) ,
UPLDeduction NUMERIC(11, 2) ,
DPSDeduction NUMERIC(11, 2) ----> This column is added by Md Arifuzzaman
,
WelfareFundDeduct NUMERIC(11, 2) -----> This Column is added by JK on 24112005 to incorporate to Welfae Fund Deduction
,
ProjectID NCHAR(3) ,
AreaID NCHAR(4) ,
CashYN BIT
)


CREATE TABLE #TMonthlyPsSalary
(
PinID NCHAR(8) ,
HRent NUMERIC(11, 2) ,
Medical NUMERIC(11, 2) ,
ConAll NUMERIC(11, 2) ,
Entertain NUMERIC(11, 2) ,
Utility NUMERIC(11, 2) ,
Technical NUMERIC(11, 2) ,
Other NUMERIC(11, 2)
)


CREATE TABLE #TProjectArea
(
PjaProjectID NCHAR(3) ,
PjaAreaID NCHAR(4) ,
PjaAccCode NVARCHAR(12)
)

CREATE TABLE #TBankList ( BankId NCHAR(3) )

CREATE TABLE #tmpProgram
(
PinID NCHAR(8) ,
ProgramID NCHAR(2)
)

IF @bankID = '%'
BEGIN
INSERT INTO #TbankList
SELECT DISTINCT
MptBankId
FROM MonthlyPaymentTransAccList
END
ELSE
BEGIN
INSERT INTO #TbankList
SELECT DISTINCT
MptBankId
FROM MonthlyPaymentTransAccList
WHERE MptBankId = @BankID
END

INSERT INTO #TProjectArea
SELECT PjaProjectId ,
PjaAreaID ,
PjaAccCode
FROM ProjectArea
WHERE PjaProjectId LIKE @ProjectID
AND PjaAreaID LIKE @AreaID

Solution of "Syed Asif Iqbal" is the good one. It answers the question "Can anyone tell me any resource or methods on how to Acsses/Read/write into the windows registry using visual c#. "

Now regarding making a windows registry key read-only: That is not possible. PC administrators will always have full rights on every single key of the registry.

In fact I am not aware of a possibility to create something read-only on a PC : Admins have (hopefully) full write rights on EVERYTHING. Even if sometimes it seems they don't have the rights on certain specific locations (like user's folders) they in fact can steal it rather easily....
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900