1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
 
namespace TrayIconRepair
{
    class Program
    {
        static void Main(string[] args)
        {
            string sTemp = DeleteTrayIconRegistry();
            Console.WriteLine("Register clear {0}", sTemp);
            System.Threading.Thread.Sleep(1000);        
        }
        
        public static void WriteRegistry(string _name, string _value)
        {
            RegistryKey regKey = Registry.CurrentUser.CreateSubKey("Software\\Test", RegistryKeyPermissionCheck.ReadWriteSubTree);
            regKey.SetValue(_name, _value, RegistryValueKind.String);
        }
 
 
        public static string ReadRegistry(string _name)
        {
            RegistryKey reg = Registry.CurrentUser;
            reg = reg.OpenSubKey("Software\\Test"true);
            if (reg == nullreturn "";
 
            if (null != reg.GetValue(_name))
            {
                return Convert.ToString(reg.GetValue(_name));
            }
            else
            {     
                return "";
            }
        }
 
        public static void DeleteRegistry()
        {
            Registry.CurrentUser.DeleteSubKey("Software\\Test");
        }
 
        public static string DeleteTrayIconRegistry()
        {
            RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\CurrentVersion\\Traynotify"true);
 
            if (reg == nullreturn "fail!";
 
            reg.DeleteValue("IconStreams"false);
            reg.DeleteValue("PastIconsStream"false);
 
            return "ok!";
        } 
 
    }

 

 }

cs

 

 

 

Windows7 버전에서 아이콘이 사라져 안보일때가 있다.

이때.. 사용할 소스코드.

 

 

Posted by +깡통+

ms 간격으로 설정 가능하다.

 

System.Threading.Thread.Sleep(1000);

Posted by +깡통+
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ReadOnlyClass
{
    class ReadOnlyClass
    {
        public int x;
        public readonly int y = 1;
        public readonly int z;

        public ReadOnlyClass()
        {
            z = 24;
        }

        public ReadOnlyClass(int x, int y, int z)
        {
            this.x = x;
            this.y = y;
            this.z = z;
        }

    }

    class Program
    {
        static void Main(string[] args)
        {
            ReadOnlyClass o1 = new ReadOnlyClass(1, 2, 3);
            Console.WriteLine("o1: x={0}, y={1}, z={2}", o1.x, o1.y, o1.z);

            ReadOnlyClass o2 = new ReadOnlyClass();
            Console.WriteLine("o2: x={0}, y={1}, z={2}", o2.x, o2.y, o2.z);

            o2.x = 5;
            o2.y = 6;
            o2.z = 7;
        }
    }
}


39~40번 라인에 문제가 있다고 컴파일 하지 않아도 친절하게 알려준다. 기특 기특. ^^


Posted by +깡통+
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ParseTest
{
    class ParseTest
    {
        enum Colors { Red = 1, Green = 2, Blue = 4, Yellow = 8 };
        static void Main(string[] args)
        {
            Console.WriteLine("컬러 열거형에는 이런 값들이 있다 :");
            foreach (string s in Enum.GetNames(typeof(Colors)))
                Console.WriteLine(s);
            Console.WriteLine();
            Colors myOrange = (Colors)Enum.Parse(typeof(Colors), "Red, Yellow");
            Console.WriteLine("오랜지색 값은 합쳐진 것이다. {0}", myOrange);
        }
    }
}

Parse 메소드는 하나 이상의 열거된 상수의 이름이나 숫자 값의 문자열 표현을 해당하는 열거된 상수로 변환한다.

즉.. 숫자를 지정하지 않았으면 문자가 튀어 나온다.

이것 참 편리한 도구다.

다른 사이트도 있을듯 한데. ㅎㅎㅎ

http://hilite.me/


Posted by +깡통+

약 20년을 우려먹은 Visual Basic 이 명줄이 다 되어 가는것 같다.

이미 대부분의 프로젝트에서는 잘 쓰지 않을 것이라 추측한다.

일단 우리 회사는 빼고 ㅎㅎ


이제 다음 먹거리를 준비해야 된다.

난 생계를 책임지는 가장으로 가족을 먹여 살려야 하는 책임도 있지만,

프로그래머라는 직업을 유지하기 위해서는 새로운 언어를 습득해야할 시기인 것이다.

야야..  지금껏 그래왔잖아!

그 옛날 GW-BASIC 부터 지금까지 언어의 한계에 부딪혀 새로운 언어를 습득 했다.

C#이 처음 나왔을땐 java 줄을 타야하나~ 고민했다.

양대 산맥으로 커준 덕택에 내가 갈 길이 좀더 분명하고 앞서 달려가신 많은 개발자 덕택에 진흙 길을 아님이 분명하다.


잘 해보자.  연말에 웃을 수 있기를!!


Posted by +깡통+
이전버튼 1 이전버튼