using System;
using System.Diagnostics;
using System.Security.Principal;
using System.Windows.Forms;

namespace HelloWorld
{
    static class Program
    {
        /// <summary>
        /// 해당 응용 프로그램의 주 진입점입니다.
        /// </summary>
        [STAThread]
        static void Main()
        {
            if (IsAdministrator() == false)
            {
                try
                {
                    ProcessStartInfo processInfo = new ProcessStartInfo();
                    processInfo.UseShellExecute = true;
                    processInfo.FileName = Application.ExecutablePath;
                    processInfo.WorkingDirectory = Environment.CurrentDirectory;
                    processInfo.Verb = "runas";
                    Process.Start(processInfo);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MonitoringForm());
        }

        /// <summary>
        /// 관리자모드 실행 확인
        /// </summary>
        /// <returns></returns>
        public static bool IsAdministrator()
        {
            WindowsIdentity identity = WindowsIdentity.GetCurrent();

            if (null != identity)
            {
                WindowsPrincipal principal = new WindowsPrincipal(identity);
                return principal.IsInRole(WindowsBuiltInRole.Administrator);
            }

            return false;
        }
    }
}
Posted by 홍상길 홍상길


기존의 Class에 추가로 함수를 추가 하는경우 사용한다.

확장 메소드의 Class는 Static으로 정의 되어야 하며 첫번째 파마메터에 this 기존클래스명 이 들어가야 한다.


public static class StringExtention

{

    public static int ToInt(this string str)

    {

        int result = 0;

        try

        {

            result = int.Parse(str);

        }

        catch

        {

        }

        return result;

    }

}



확장 메소드 등록 시 아래처럼 상용이 가능하다.


Posted by 홍상길 홍상길

Android - 이미지 폴더의 하위 폴더 가져오기




String path2 = Environment.getExternalStorageDirectory().toString()+"/Pictures/";
Log.d("H_Log", "Path: " + path2);
File f = new File(path2);
File file[] = f.listFiles();
Log.d("H_Log", "Size: "+ file.length);

for (int i=0; i < file.length; i++)
{
    Log.d("H_Log", "FileName:" + file[i].getName());
}


'Programming > Android' 카테고리의 다른 글

이미지 폴더의 하위 폴더 가져오기  (0) 2015.12.06
환경 구축  (0) 2015.12.05
[Android] 화면 위치 고정하기(화면 회전 방지)  (0) 2012.01.10
Posted by 홍상길 홍상길

[Android] 안드로이드 개발 환경 구축하기 (안드로이드 스튜디오)

http://javaking75.blog.me/220473789188

'Programming > Android' 카테고리의 다른 글

이미지 폴더의 하위 폴더 가져오기  (0) 2015.12.06
환경 구축  (0) 2015.12.05
[Android] 화면 위치 고정하기(화면 회전 방지)  (0) 2012.01.10
Posted by 홍상길 홍상길

SPListItem 의 Update 속성은 아래 4가지가 있다.

SystemUpdate() 수정자와 수정일자를 업데이트 하지않는고, 신규 버전을 생성 하지 않는다.
SystemUpdate(Boolean) 수정자와 수정일자를 업데이트 하지않고, Boolean이 "true"일 경우 신규 버전을 생성 "false"일 경우 신규 버전을 생성하지 않는다.
Update() 수정자와 수정일자가 업데이트 되고 신규 버전이 생성 된다.
UpdateOverwriteVersion() 수정자와 수정일자가 업데이트 되고 신규 버전은 생성되지 않는다.

 

Event Receiver의 ItemUpdated 메소드에서 SPListItem 을 업데이트 하는 경우 아래의 오류가 발생 되는 경우가 있다.

 

파일이 ******의 공유 사용을 위해 잠겼습니다. Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)

 

이는 owa 또는 다른곳에서 해당 문서를 사용하는 경우 발생 되며, 이때는 SystemUpdate() 또는 SystemUpdate(false)를 사용하면 해결 된다.

 

 

 

 

 

 

 

 

 

 

 

Posted by 홍상길 홍상길

Microsoft.Office.Server.UserProfiles.LMTRepopulationJob Exception 발생 시

AppFabricCachingService에서 발생 되는 문제로 해당 서비스를 초기화 해주자!

 

Sharepoint Management Shell 에서 아래 명령 실행.

 

Restart-Service AppFabricCachingService
Posted by 홍상길 홍상길

1. Show Off Your Style with SharePoint Theming

Theming in SharePoint 2013 makes it easier to drastically change the look of your site and make it your own. That said, the new look of SharePoint sites is great, so why would you want to change it?

http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=1043

2. Certain Microsoft SharePoint Server 2013 installation scenarios are not supported

This article describes Microsoft SharePoint Server 2013 installation scenarios that are not supported.

http://support.microsoft.com/kb/2764086

3. Global Solutions for SharePoint 2013

This model provides architectural guidance for geographically distributed deployments of SharePoint 2013.

http://www.microsoft.com/en-us/download/details.aspx?id=34975

4. Backup and restore: SharePoint Server 2013

This model illustrates various ways that you can back up and restore a SharePoint environment.

http://www.microsoft.com/en-us/download/details.aspx?id=30365

5. Databases that support SharePoint 2013 Preview

This model illustrates the databases that that support SharePoint 2013 Preview.

http://www.microsoft.com/en-us/download/details.aspx?id=30363

6. Design Sample: Corporate Portal with Host-named Sites for SharePoint Server 2013

This design sample illustrates the use of host-named site collections with all sites deployed in a single web application on the farm. This method is highly scalable and is flexible in managing URLs.

http://www.microsoft.com/en-us/download/details.aspx?id=30362

7. Design Sample: Corporate Portal with Path-based Sites for SharePoint Server 2013

This design sample illustrates the use of path-based site collections with sites organized into dedicated web applications and a single top-level site collection per web application.

http://www.microsoft.com/en-us/download/details.aspx?id=30378

8. Design Sample: Extranet with Dedicated Zones for Authentication for SharePoint 2013

This design sample illustrates many top-level project sites with vanity URLs by using host-named sites for each project site (instead of organizing project sites underneath a top-level site collection).

http://www.microsoft.com/en-us/download/details.aspx?id=30368

9. Downloadable eBook: Deployment guide for SharePoint 2013

Download this free ebook to learn how to install and configure SharePoint Server and SharePoint Foundation.

http://www.microsoft.com/en-us/download/details.aspx?id=30384

10. Downloadable eBook: Explore SharePoint 2013

Download this free eBook to learn more about what's new in SharePoint 2013.

http://www.microsoft.com/en-us/download/details.aspx?id=30368

11. Enterprise search architectures for SharePoint Server 2013

This design sample shows the search architecture for a variety of sizes of server farms.

http://www.microsoft.com/en-us/download/details.aspx?id=30383

12. Incoming email planning worksheet

This worksheet helps you record information to help you plan for incoming email in a SharePoint deployment.

http://www.microsoft.com/en-us/download/details.aspx?id=34805

13. Microsoft SharePoint Products and Technologies Protocol Documentation

The Microsoft SharePoint Products and Technologies protocol documentation provides technical specifications for Microsoft proprietary protocols that are implemented and used in SharePoint Products and Technologies.

http://www.microsoft.com/en-us/download/details.aspx?id=25255

14. Multi-farm architectures with SharePoint Server 2013

This model provides architectural guidance for multi-farm deployments of SharePoint Server 2013.

http://www.microsoft.com/en-us/download/details.aspx?id=34973

15. Search architectures for SharePoint Server 2013

This design sample shows the search architecture for a medium size server farm.

http://www.microsoft.com/en-us/download/details.aspx?id=30374

16. Services in SharePoint Server 2013

This illustration provides information about services that are available in SharePoint Server 2013.

http://www.microsoft.com/en-us/download/details.aspx?id=30402

17. SharePoint 2013 Upgrade Process

This model explains the process that you use when you upgrade from SharePoint Foundation 2010 or SharePoint Server 2010 to SharePoint Foundation 2013 or SharePoint Server 2013.

http://www.microsoft.com/en-us/download/details.aspx?id=30371

18. SharePoint 2013: App Overview for IT Pro

The app model in SharePoint 2013 enables SharePoint environments to add functionality quickly and securely.

http://www.microsoft.com/en-us/download/details.aspx?id=30373

19. SharePoint 2013: How to Test Upgrade

This model explains how to create a test environment to use when you upgrade from SharePoint Server 2010 or SharePoint Foundation 2010 to SharePoint 2013 Products

http://www.microsoft.com/en-us/download/details.aspx?id=30366

20. Test Lab Guide: Configure SharePoint Server 2010 in a Three-Tier Farm

This paper contains step-by-step instructions for creating a test lab containing a three-tier SharePoint farm.

http://www.microsoft.com/en-us/download/details.aspx?id=29420

21.Topologies for SharePoint 2013

The versatility of SharePoint 2013 provides opportunities to develop a topology that satisfies your business goals.

http://www.microsoft.com/en-us/download/details.aspx?id=30377

22.User profile properties and profile synchronization planning worksheets for SharePoint Server 2013

The following planning worksheets can assist you when planning user profiles or planning and configuring profile synchronization.

http://www.microsoft.com/en-us/download/details.aspx?id=35404

23.White Paper: Office 2013--Access Services Setup for an On-Premises Installation

This white paper provides instructions that will help you configure SQL Server 2012 for Access Services in SharePoint Server 2013. It includes instructions for an on-premises installation and configuration of Access Services on a server that is running SharePoint Server 2013.

http://www.microsoft.com/en-us/download/details.aspx?id=30445 

 

 

출처 : http://msmvps.com/blogs/sundar_narasiman/default.aspx

 

Posted by 홍상길 홍상길
 
 
----------------------------------------------------------------------------------------------------------------------------------------

Package managers for external libraries

  • NuGet (formerly known as NuPack) - Microsoft (developer-focused package management system for the .NET platform intent on simplifying the process of incorporating third party libraries into a .NET application during development)
  • OpenWrap - Sebastien Lambla - Open Source Dependency Manager for .net applications

Build Tools

  • Prebuild - Generate project files for all VS version, including major IDE's and tools like SharpDevelop, MonoDevelop, NAnt and Autotools

Dependency Injection/Inversion of Control

Logging

Validation

Design by Contract

Compression

Ajax

Data Mapper

ORM

Charting/Graphics

PDF Creators/Generators

Unit Testing/Mocking

Automated Web Testing

Misc Testing/Quality Support/Behavior Driven Development (BDD)

URL Rewriting

Web Debugging

  • Glimpse - Firebug for your webserver

Controls

MS Word/Excel Documents Manipulation

  • DocX to create, read, manipulate formatted word documents. Easy syntax, working nicely, actively developed. No Microsoft Office necessary.
  • Excel XML Writer allows creation of .XLS (Excel) files. No Microsoft Office necessary. Been a while since it has been updated. It also provides code generator to create code from already created XLS file (saved as xml). Haven't tested this but looks very promising. Too bad author is long time gone.
  • Excel Reader allows creation/reading of .XLS (Excel) files. No Microsoft Office necessary. Been a while since it has been updated.
  • Excel Package allows creation/reading of .XLSX (Excel 2007) files. No Microsoft Office necessary. Author is gone so it's out of date.
  • EPPlus is based on Excel Package and allows creation/reading of .XLSX (Excel 2007). It is actually the most advanced even comparing to NPOI.
  • NPOI is the .NET version of POI Java project at http://poi.apache.org/. POI is an open source project which can help you read/write xls, doc, ppt files.

Social Media

  • LinqToTwitter - Linq-based wrapper for all Twitter API functionality in C#
  • Facebook C# SDK - A toolkit for creating facebook applications / integrating websites with Facebook using the new Graph API or the old rest API.

Serialisation

  • sharpserializer - xml/binary serializer for wpf, asp.net and silverlight
  • protobuf-net - .NET implementation of google's cross-platform binary serializer (for all .NET platforms)

Unclassified

Posted by 홍상길 홍상길

Microsoft 에서 제공 하고 있는 ControlTemplate Examples 입니다.

ListBox, TreeView등등의 컨트롤에 기본적으로 적용되어있는 Template을 확인 할 수 있습니다.

컨트롤에 맞는 Template 으로 커스터 마이징이 가능 합니다.

 

[제공 Template]

n  Button ControlTemplate Example

n  CheckBox ControlTemplate Example

n  ComboBox ControlTemplate Example

n  ComboBoxItem ControlTemplate Example

n  ContextMenu ControlTemplate Example

n  DocumentViewer ControlTemplate Example

n  Expander ControlTemplate Example

n  Frame ControlTemplate Example

n  GroupBox ControlTemplate Example

n  Label ControlTemplate Example

n  ListBox ControlTemplate Example

n  ListBoxItem ControlTemplate Example

n  ListView ControlTemplate Example

n  ListViewItem ControlTemplate Example

n  Menu ControlTemplate Example

n  MenuItem ControlTemplate Example

n  NavigationWindow ControlTemplate Example

n  ProgressBar ControlTemplate Example

n  RadioButton ControlTemplate Example

n  ScrollBar ControlTemplate Example

n  ScrollViewer ControlTemplate Example

n  Slider ControlTemplate Example

n  StatusBar ControlTemplate Example

n  TabControl ControlTemplate Example

n  TabItem ControlTemplate Example

n  TextBox ControlTemplate Example

n  ToolBar ControlTemplate Example

n  ToolTip ControlTemplate Example

n  TreeView ControlTemplate Example

n  TreeViewItem ControlTemplate Example

n  Window ControlTemplate Example

 

다운로드는 아래 사이트에서 받아가세요!

 

 

ControlTemplate Examples : http://msdn.microsoft.com/en-us/library/vstudio/aa970773(v=vs.90).aspx

Posted by 홍상길 홍상길

Behind Code에서 Master Page의 Title 변경 하는 방법에 대해 알아 보겠습니다.

 

// Master Page에 등록되어있는 PlaceHolder 명과 설정할 Title 값을 매개변수로 입력 합니다. 

         private void SetTitle(string placeHolderName, string title)
        {
            try
            {

// 현재 페이지의 MasterPage의 PlaceHolder을 가져옵니다. 

                ContentPlaceHolder contentPlaceHolder = (ContentPlaceHolder)Page.Master.FindControl(placeHolderName);
                contentPlaceHolder.Controls.Clear();
                LiteralControl literalControl = new LiteralControl();
                literalControl.Text = title;

// Title을 등록 한 후 가져온 PlaceHolder Control에 입력 합니다. 

                contentPlaceHolder.Controls.Add(literalControl);
            }
            catch {
            }
        }

 

함수 호출은 아래와 같이!!

SetTitle("PlaceHolderPageTitle", "타이틀수정!");
Posted by 홍상길 홍상길

블로그 이미지
홍상길

공지사항

Yesterday19
Today13
Total292,410

달력

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

최근에 달린 댓글

글 보관함