삽질61 [Delphi] InnoSetup : 설치 시 강제로 프로세스 죽이기 [Files]Source: "progtest.exe"; DestDir: "{app}"; BeforeInstall: TaskKill(progtest.exe) [Code]procedure TaskKill(FileName: String);var ResultCode: Integer;begin Exec(ExpandConstant('taskkill.exe'), '/f /im ' + '"' + FileName + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); end; 2017. 10. 2. [Delphi] Embeddedwb에서 Post로 보내기, User-Agent 보내기 쓸데없이 삽질했음.. var i: Integer; strData: string; Empty: OleVariant; Header: OleVariant; Post: OleVariant;begin strData := 'id=' + UserID + '&' + 'passwd=' + UserPW; // post 보낼 값 Post := VarArrayCreate([0, Length(strData) - 1], varByte); for i := 1 to Length(strData) do Post[i - 1] := Ord(strData[i]); Header := 'Content-type: application/x-www-form-urlencoded' + #10#13 + 'User-Agent: 여기넣기' + #10#13; .. 2016. 10. 18. [Ruby] 빈 공간 텍스트 채우기 "hello".ljust(4) #=> "hello""hello".ljust(20) #=> "hello ""hello".ljust(20, '1234') #=> "hello123412341234123" "hello".rjust(20, '1234') #=> "123412341234123hello" 2014. 11. 28. [Ruby] Time 비교하기 time1 = Time.nowtime2 = Time.now + 120 # 2분 후 timecheck = time2 - time1 case timecheckwhen 0 then p 'just now'when 1 then p 'a second ago'when 2..59 then p timecheck.to_s + ' seconds ago' when 60..119 then p 'a minute ago' # 120 = 2 minuteswhen 120..3540 then p (timecheck/60).to_i.to_s + ' minutes ago'when 3541..7100 then p 'an hour ago' # 3600 = 1 hourwhen 7101..82800 then p ((timecheck+99)/360.. 2014. 11. 26. [Ruby] File Time File.atime('파일주소') # Returns the last access timeFile.ctime('파일주소') # Returns the change time for file File.mtime('파일주소') # Returns the modification time for file. http://ruby-doc.org/core-1.9.3/File.html 2014. 11. 26. [Ruby] html 예제 왜 자꾸 까먹지.. data = Hpricot(data) data.search('//table[@class="table_02"]')[1] data.search('//iframe[@id="arap"]').attr('src').to_s (str_line.search("td")[3]/"text()").to_s.strip.gsub(/\t|\n/, "") data_list.search("//tr").each do |str_line|# (str_line.search("td")[0]/"a"/"text()")[0].to_s# (str_line.search("td")[0]/"text()").to_s# str_line.search("//td[@class='center']")[0]end http = HTTPClient.ne.. 2014. 11. 26. [WP7] 비트맵을 브러시로 비트맵을 브러시로 ImageBrush ib = new ImageBrush();ib.ImageSource = new BitmapImage(new Uri("이미지", UriKind.Relative));img.Foreground = ib; 2014. 6. 30. [WP7] Horizontal ListBox 리스트박스 가로로 보여주기 2013. 8. 9. [Delphi] InnoSetup : 설치 전, 설치 후 함수 호출하기 [BeforeInstall] [Files]Source: "MYPROG.EXE"; DestDir: "{app}"; BeforeInstall: MyBeforeInstallSource: "A\MYFILE.TXT"; DestDir: "{app}"; BeforeInstall: MyBeforeInstall2('{app}\A\MYFILE.TXT') [AfterInstall] [Files]Source: "MYPROG.EXE"; DestDir: "{app}"; AfterInstall: MyAfterInstallSource: "A\MYFILE.TXT"; DestDir: "{app}"; AfterInstall: MyAfterInstall2('{app}\A\MYFILE.TXT') [Code]procedure MyBeforeI.. 2013. 8. 7. [Delphi] InnoSetup : event 함수들 [Setup event functions] function InitializeSetup(): Boolean;Called during Setup's initialization. Return False to abort Setup, True otherwise.procedure InitializeWizard();Use this event function to make changes to the wizard or wizard pages at startup. You can't use theInitializeSetup event function for this since at the time it is triggered, the wizard form does not yet exist.procedure Deinitia.. 2013. 8. 7. 이전 1 2 3 4 5 ··· 7 다음