블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2731)
Unity3D (814)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (57)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (51)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
03-29 07:22

'레지스트리'에 해당되는 글 2건

  1. 2011.07.18 환경변수(시스템변수) 자동 등록
  2. 2010.07.22 레지스트리 값 읽고, 쓰기 방법

환경변수 자동으로 추가하기

http://pragmaticstory.com/161

- 프로그램밍적으로 환경변수 등록하기
(환경변수/시스템변수 레지 위치)
Win7은 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 을 사용해야 될듯 함.
http://prodev.springnote.com/pages/1948392

- 자바 환경변수 자동 등록 배치 파일
http://blog.naver.com/PostView.nhn?blogId=huilin21&logNo=90040087259



시스템 변수 자동 등록

Win7 - cmd 창에서 전역환경변수 설정하기(bat 파일로 만들면 됨)

 http://zextor.tistory.com/2670089
반응형
Posted by blueasa
, |

using Microsoft.Win32;  // RegistryKey 사용을 위해 추가

namespace RegTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        // 레지스트리 가져오기
        private string getReg(string regVal)
        {
            RegistryKey reg = Registry.LocalMachine;
            reg = reg.OpenSubKey("Software\\myProgram", true);
            if (reg == null)
                return "";
            else
                return Convert.ToString(reg.GetValue(regVal)); // 값 검색
        }

        // 레지스트리 쓰기
        private void setReg(string regKey, string regVal)
        {
            RegistryKey reg = Registry.LocalMachine;
            reg = reg.CreateSubKey("Software\\myProgram",
                   RegistryKeyPermissionCheck.ReadWriteSubTree);
            reg.SetValue(regKey, regVal, RegistryValueKind.String);
            reg.Close();
        }

        // 등록 버튼
        private void button1_Click(object sender, EventArgs e)
        {
            string regKey = textBox1.Text;
            string regVal = textBox2.Text;

            setReg(regKey, regVal);
           
        }

        // 읽기 버튼
        private void button2_Click(object sender, EventArgs e)
        {
            string regKey = textBox1.Text;
            textBox2.Text = getReg(regKey);
        }
    }
}

출처 : http://blog.daum.net/starkcb/165

반응형
Posted by blueasa
, |