블로그 이미지
010-9967-0955 보미아빠

카테고리

보미아빠, 석이 (500)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2024.5
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

공지사항

최근에 올라온 글

'보미아빠, 석이'에 해당되는 글 500건

  1. 2017.06.14 ssms 에러
  2. 2017.06.12 json
  3. 2017.06.12 Using Java Classes in your .NET Application
  4. 2017.06.05 powershell
  5. 2017.03.07 로그인 복사
  6. 2016.12.30 psexec
  7. 2016.12.19 ssdt
  8. 2016.12.16 gearfit2 - iphone ios 연동
  9. 2016.12.08 qlik sense reload c#
  10. 2016.12.05 garmin fenix 3 hr 저장공간 에러 2

ssms 에러

카테고리 없음 / 2017. 6. 14. 14:05
Posted by 보미아빠
, |

json

카테고리 없음 / 2017. 6. 12. 13:41
Posted by 보미아빠
, |

 

https://www.codeproject.com/Articles/13549/Using-Java-Classes-in-your-NET-Application

 

 

IKVM.NET is an open source implementation of Java for Mono /Microsoft .NET Framework and makes it possible both to develop .NET applications in Java, and to use existing Java APIs and libraries in applications written in any .NET language.
Is your email address OK? You are signed up for our newsletters but your email address is either unconfirmed, or has not been reconfirmed in a long time. Please click here to have a confirmation email sent so we can confirm your email address and start sending you newsletters again. Alternatively, you can update your subscriptions.

Introduction

Suppose you have been asked to migrate an existing multi-tier application to .NET where the business layer is written in Java. Normally you would have no option but to recode and port the entire application to any .NET language (e.g. C#).  However this is where IKVM.NET comes to the rescue.

IKVM.NET is an open source implementation of Java for Mono /Microsoft .NET Framework and makes it possible both to develop .NET applications in Java, and to use existing Java API's and libraries in applications written in any .NET language. It is written in C# and the executables, documentation and source code can be downloaded from here.

IKVM.NET consists of the following three main parts:

  1. A Java Virtual Machine implemented in .NET
  2. A .NET implementation of the Java class libraries
  3. Tools that enable Java and .NET interoperability

However before we get any further into this topic, let’s discuss about few of the main components of the IKVM.NET package which we would be using later in this article.

  • IKVM.Runtime.dll: The VM runtime and all supporting code containing the byte code JIT compiler/verifier, object model remapping infrastructure and the managed .NET re-implementations of the native methods in Classpath. 
  • IKVM.GNU.Classpath.dll: Compiled version of GNU Classpath, the Free Software Foundation's implementation of the Java class libraries, plus some additional IKVM.NET specific code. 
  • ikvm.exe: Starter executable, comparable to java.exe ("dynamic mode").
  • ikvmc.exe: Static compiler. Used to compile Java classes and jars into a .NET assembly ("static mode").

Now back to our problem of migrating the existing Java business classes so that they can be accessed by the newly proposed .NET application. We would also like to use the various existing Java API and libraries in our .NET application.  Let’s start by doing just that.

Setting Up IKVM.NET

Download the binary distribution from the sourceforge site and unzip the contents to C:\ikvm (or X:\ikvm where X is your drive). You would find the ikvm executables and DLLs in the C:\ikvm\bin directory.  Open a command or shell window, cd to C:\ikvm\bin, and type ‘ikvm’.

If your system is operating correctly, you should see the following output:

usage: ikvm [-options] <class> [args...] (to execute a class) or ikvm -jar [-options] <jarfile> [args...] (to execute a jar file)

For Linux based systems, the setup is similar as above. This is all you need to do for running the demo application.

Our Demo Java Business Class (JavaToNet.java)

public class JavaToNet 
{
    public static void main(String[] args) 
    {
        System.out.println("This is a demonstration Program which\n");
        System.out.println("shows the conversion of Java class to\n");
        System.out.println("a .NET dll\n");
    }
    public  static double AddNumbers(double a,double b){
    double c = 0;
    c = a + b;
    return c;    
    }
    public  static double SubNumbers(double a,double b){
        double c = 0;
        c = a - b;
        return c;    
        }
    public  static double MulNumbers(double a,double b){
        double c = 0;
        c = a * b;
        return c;    
        }
    public  static double DivNumbers(double a,double b){
        double c = 0;
        c = a / b;
        return c;    
        }
}

Our Java class is very simple. It has four functions for add, subtract, multiply and divide that take two double values and return a result. Our objective is to access these functions through our C# application. Compile the above Java file to get the JavaToNet.class. We will use this Java class file to generate the .NET DLL to be referenced in our C# program.

Using IKVM.NET to Convert Java Class to .NET DLL

Copy the above Java class file (JavaToNet.class) to the C:\ikvm\bin directory. Now run the following command:

This would create the JavaToNet.dll from the JavaToNet.class file. There are other command line option for ikvmc.exe. For example: ‘ikvmc –target:exe javaToNet.class’ would create an EXE and not a DLL. You can get all the options by typing ‘ikvmc’ in the command line.

Setting Up Your .NET Development Environment

  1. Start by creating a C# Windows application project. 

  2. Drag and drop controls into the form as shown:

  3. Add the following DLLs as references to the project. Both DLLs are present in the C:\ikvm\bin folder.

    • JavaToNet.dll
    • IKVM.GNU.Classpath.dll
  4. Add the following code to the button click event of the ‘Calculate’ button:

    private void btnCal_Click(object sender, System.EventArgs e)
    {
    if (rdAdd.Checked == true)
        {
        txtResult.Text = Convert.ToString(JavaToNet.AddNumbers
    	(Convert.ToDouble(txtNum1.Text),Convert.ToDouble(txtNum2.Text)));
        }else if (rdSub.Checked ==true)
        {
        txtResult.Text = Convert.ToString(JavaToNet.SubNumbers
    	(Convert.ToDouble(txtNum1.Text),Convert.ToDouble(txtNum2.Text)));                
        }
        else if (rdMul.Checked == true)
        {
        txtResult.Text = Convert.ToString(JavaToNet.MulNumbers
    	(Convert.ToDouble(txtNum1.Text),Convert.ToDouble(txtNum2.Text)));                
        }
        else
        {
        txtResult.Text = Convert.ToString(JavaToNet.DivNumbers
    	(Convert.ToDouble(txtNum1.Text),Convert.ToDouble(txtNum2.Text)));            
        }
    }
  5. Add the following using directive on the top of the *.cs file:

    using TimeZone = java.util.TimeZone;
  6. Add the following code to the button click event of the ‘Time Zone’ button.

    private void btnTimeZone_Click(object sender, System.EventArgs e)
    {
    MessageBox.Show(TimeZone.getDefault().getDisplayName());
    }
  7. Compile and run the application. The C# application would now call the AddNumbers(), SubNumbers(), MulNumbers() and DivNumbers() functions present in the JavaToNet.dll and return the result.

  8. Click on the ‘Time Zone’ button. The application accesses the java.util.TimeZone class and displays the exact time zone of the place.

Conclusion

Since these methods had originally been written in Java, IKVM.NET provides us an easy and viable way to access those classes and methods from a .NET application. Similarly as shown above in the ‘Time Zone’ example, you can access most of the existing Java packages (e.g. java.io, java.util, etc.) and use them in your application.

However there are certain drawbacks. IKVM.NET, while still being actively developed, has limited support for AWT classes and hence porting Java GUI can be ruled out at present. Also some of the default Java classes are still being ported so you might not get all the functionalities you require. Also if your application depends on the exact Java class loading semantics, you might have to modify it to suit your needs.

History

  • 03-25-06 Initial publication

License

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

Posted by 보미아빠
, |

powershell

카테고리 없음 / 2017. 6. 5. 11:17

remote command 활성화

https://technet.microsoft.com/en-us/library/ff700227.aspx

 

 

 

get-service winrm

Start-Service winrm

get-service winrm

winrm s winrm/config/client '@{TrustedHosts="WIN-6S4NEPKTVUI"}'

winrm quickconfig

 

파일 /  새 원격 PowerShell 탭

인증 ...

 

 

 

PowerShell 책

http://www.reedbushey.com/86Windows%20Powershell%20Cookbook%203rd%20Edition.pdf

 

 

C# 으로 powershell 불러쓰기

https://blogs.msdn.microsoft.com/kebab/2014/04/28/executing-powershell-scripts-from-c/

 

 

 

sql parameter

http://sql-articles.com/articles/general/enable-disable-trace-flags-in-sql-server/

 

 

 

기본 쿼리

https://msdn.microsoft.com/ko-kr/powershell/scripting/getting-started/cookbooks/working-with-registry-entries

 

 

sql parameter 쿼리하기

[mon]: PS C:\Users\db\Documents> Get-ItemProperty -Path Registry::"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQLServer\Parameters"

 

파일 읽어서 반환하기

 

등등

 

 using (PowerShell PowerShellInstance = PowerShell.Create())
                {

                    string cmd = @"Get-Item -Path Registry::\'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server'";
                    PowerShellInstance.AddScript(cmd);
                    Console.WriteLine(cmd);

                    Collection<PSObject> PSOutput = PowerShellInstance.Invoke();
                    foreach (PSObject outputItem in PSOutput)
                    {
                        // if null object was dumped to the pipeline during the script then a null
                        // object may be present here. check for null to prevent potential NRE.
                        if (outputItem != null)
                        {
                            if (PowerShellInstance.Streams.Error.Count > 0)
                            {
                                Console.WriteLine("Error");
                            }
                            else
                            {
                                Console.WriteLine(outputItem.BaseObject.GetType().FullName);
                                Console.WriteLine(outputItem.BaseObject.ToString() + "\n");

                                if (outputItem.BaseObject is RegistryKey)
                                {
                                    RegistryKey rk = outputItem.BaseObject as RegistryKey;
                                    string[] valueNames = rk.GetValueNames();
                                    foreach (string s in valueNames)
                                    {
                                        RegistryValueKind rvk = rk.GetValueKind(s);
                                        switch (rvk)
                                        {
                                            case RegistryValueKind.MultiString:
                                                string[] values = (string[])rk.GetValue(s);
                                                Console.Write("\r\n {0} ({1}) =", s, rvk);
                                                for (int i = 0; i < values.Length; i++)
                                                {
                                                    if (i != 0) Console.Write(",");
                                                    Console.Write(" \"{0}\"", values[i]);
                                                }
                                                Console.WriteLine();
                                                break;

                                            case RegistryValueKind.Binary:
                                                byte[] bytes = (byte[])rk.GetValue(s);
                                                Console.Write("\r\n {0} ({1}) =", s, rvk);
                                                for (int i = 0; i < bytes.Length; i++)
                                                {
                                                    // Display each byte as two hexadecimal digits.
                                                    Console.Write(" {0:X2}", bytes[i]);
                                                }
                                                Console.WriteLine();
                                                break;

                                            default:
                                                Console.WriteLine("\r\n {0} ({1}) = {2}", s, rvk, rk.GetValue(s));
                                                break;
                                        }
                                    }
                                }

 

                            }
                        }
                       

                    }
                }
 

Posted by 보미아빠
, |

https://support.microsoft.com/en-us/help/918992/how-to-transfer-logins-and-passwords-between-instances-of-sql-server

Posted by 보미아빠
, |

psexec

카테고리 없음 / 2016. 12. 30. 13:56

psexec \\ip cmd

net localgroup "Event Log Readers" yourusername /add

exit



Posted by 보미아빠
, |

ssdt

카테고리 없음 / 2016. 12. 19. 14:16

https://msdn.microsoft.com/en-us/library/mt204009.aspx

http://www.techrepublic.com/blog/data-center/auto-deploy-and-version-your-sql-server-database-with-ssdt/

Posted by 보미아빠
, |

(iTunes)_GearManager1616092201_Volt_Phase4.zip.001

(iTunes)_GearManager1616092201_Volt_Phase4.zip.002

(iTunes)_GearManager1616092201_Volt_Phase4.zip.003

 

7zip 으로 합쳐서 itunes 로 설치하고 핸드폰에서 설정> 기본> 삼성 찾아서 신뢰

fit2 에서 핸드폰연결 - 핸드폰에서 gear 찾기 이러면 끝!

 

전화오면 누가 전화 했는지 뜨고

문자오면 문자내용까지 보임

중고나라 7만원 Get!

가성비 최고 봄양 선물로 사줌!

 

 

Posted by 보미아빠
, |

https://community.qlik.com/docs/DOC-8866 

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using Qlik.Engine;

namespace qsreload
{
    class Program
    {
        static void Main(string[] args)
        {
            string app = "";
            string url = "ws://localhost";
            bool partial = false;

            foreach (string arg in args)
            {
                Console.WriteLine(arg);
                if (arg.StartsWith("-a="))
                {
                    app = arg.Substring(3);
                }

                if (arg == "-p")
                {
                    partial = true;
                }

                if (arg.StartsWith("-u="))
                {
                    url = arg.Substring(3);
                }
            }

            ILocation location;

            try
            {
                location = Qlik.Engine.Location.FromUri(new Uri(url));
                //location.AsNtlmUserViaProxy(proxyUsesSsl: false);
                location.AsDirectConnectionToPersonalEdition(); 데스크탑인 경우
                IEnumerable<IAppIdentifier> apps = location.GetAppIdentifiers();
                while (true)
                {
                    bool found = false;

                    foreach (var salmon in apps)
                    {
                        if (salmon.AppName == app)
                        {
                            Console.WriteLine("Performing " + (partial ? "PARTIAL " : "") + "reload of " + salmon.AppName + " ");
                            IApp foundApp = location.Hub().OpenApp(salmon.AppId);
                            bool ging = foundApp.DoReload(0, partial);
                            Console.WriteLine("Success: " + ging);
                            foundApp.DoSave();
                            found = true;
                        }
                    }
                    Thread.Sleep(1000 * 1);
               
               
                    if (!found)
                    {
                        Console.WriteLine("App " + app + " could not be found");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Connection to Qlik Sense Proxy at " + url + " failed");
                Console.WriteLine(ex.GetBaseException());
                Console.ReadKey();
            }
        }
    }
}

Posted by 보미아빠
, |

소프트웨어 업데이트 fenix 사용 가능한 저장 공간이 충분하지 않습니다. 자세히 알아보십시오.


이렇게 뜨는데, fit 파일을 다 지워도 안되더라.....

숨겨진 폴더에 eventlog 가 있는데 그거 다 지우고

garmin express 로 업데이트 하니 

3.9 에서 4.0 으로 업데이트되고 더이상 에러가 발생하지 않더라......


수입사에서 보내돌라고 하는데 택배비 아까워서 그냥 자가 조치...



Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함