1. [root@localhost~]# vi /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php

<?php
$_SESSION["SERVEUR_SQL"]="localhost";
$_SESSION["COMPTE_BASE"]="ocsuser";
$_SESSION["PSWD_BASE"]="비밀번호";
?>

 

2. vi /etc/apache2/conf-available/z-ocsinventory-server.conf

  PerlSetEnv OCS_DB_NAME ocs
  PerlSetEnv OCS_DB_LOCAL ocs
  # User allowed to connect to database
  PerlSetEnv OCS_DB_USER ocsuser
  # Password for user
  PerlSetVar OCS_DB_PWD 비밀번호

 

3. vi /etc/apache2/conf-available/zz-ocsinventory-restapi.conf

  $ENV{OCS_DB_LOCAL} = 'ocs';
  $ENV{OCS_DB_USER} = 'ocsuser';
  $ENV{OCS_DB_PWD} = '비밀번호';
</Perl>

 

4. mysql -u root -p

mysql> GRANT ALL ON ocs.* TO ocs@localhost IDENTIFIED BY '비밀번호'; 
Query OK, 0 rows affected (0.00 sec) 

mysql> FLUSH PRIVILEGES;
mysql> exit;

참고링크 : https://msdn.microsoft.com/ko-kr/library/d1ae6tz5(v=vs.120).aspx


Vcclr.h에서 PtrToStringChars를 사용하여 String을 네이티브 wchar_t * 또는 char *로 변환할 수 있습니다. 이렇게 하면 항상 와이드 유니코드 문자열 포인터가 반환됩니다. CLR 문자열은 내부적으로 유니코드이기 때문입니다. 그런 다음 아래 예제에서와 같이 와이드 문자열을 변환할 수 있습니다.

// convert_string_to_wchar.cpp
// compile with: /clr
#include < stdio.h >
#include < stdlib.h >
#include < vcclr.h >

using namespace System;

int main() {
   String ^str = "Hello";

   // Pin memory so GC can't move it while native function is called
   pin_ptr<const wchar_t> wch = PtrToStringChars(str);
   printf_s("%S\n", wch);

   // Conversion to char* :
   // Can just convert wchar_t* to char* using one of the 
   // conversion functions such as: 
   // WideCharToMultiByte()
   // wcstombs_s()
   // ... etc
   size_t convertedChars = 0;
   size_t  sizeInBytes = ((str->Length + 1) * 2);
   errno_t err = 0;
   char    *ch = (char *)malloc(sizeInBytes);

   err = wcstombs_s(&convertedChars, 
                    ch, sizeInBytes,
                    wch, sizeInBytes);
   if (err != 0)
      printf_s("wcstombs_s  failed!\n");

    printf_s("%s\n", ch);
}
Hello


'개발' 카테고리의 다른 글

Visual Studio Community버전에서 Windows Form Application 개발  (0) 2018.11.28
참고 링크 : https://www.bogotobogo.com/cplusplus/application_visual_studio_2013.php
The simplest UI program
  1. Select Visual C++ CLR and CLR Empty Project 
    and type in RandomNumberGenerator for the project name. The, OK.
  2. Project->Add New Item... 
    Select UI under Visual C++.
    Leave the Form name as given by default MyForm.h.
    Then, click Add

    MyForm.png


  3. We need to edit the MyForm.cpp file:
    #include "MyForm.h"
    
    using namespace System;
    using namespace System::Windows::Forms;
    
    
    [STAThread]
    void Main(array<String^>^ args)
    {
    	Application::EnableVisualStyles();
    	Application::SetCompatibleTextRenderingDefault(false);
    
    	RandomNumberGenerator::MyForm form;
    	Application::Run(%form);
    }
      
    The System namespace provides functions to work with UI controls.
  4. At the right-mouse click on RandomNumberGenerator, we get the Propertieswindow. 
    Configuration Properties->Linker->System
    Select Windows (/SUBSYSTEM:WINDOWS) for SubSystem.
    Advanced->Entry Point, type in Main.
    The, hit OK.
  5. Hit F5, then we will have to run result, the Form.


'개발' 카테고리의 다른 글

System::String을 wchar_t* 또는 char*로 변환  (0) 2018.11.28

+ Recent posts