본문 바로가기

개발30

WCF에서 session은 써야 겠고, wsHttpBinding을 쓰자니 인증 어쩌고 하고.. WCF에서 Session을 쓰려면 BasicHttpBinding은 통하지 않는다.그렇다고 wsHttpBinding을 쓰면 로컬에서는 상관없는데 본 서버에 올리면 서비스가 호출이가 인증이 어쩌고 하면서 머리아프게함.핵심은 wsHttpBinding 옵션인데.. security mode="None" 으로 처음 놓고 해보니, Session 안댄다고 질알..열심히 찾아보니! reliableSession enabled="true"로 해주면 세션이 살아남. 정리해서 web.config에 다음과 같은 형식으로 추가. 2013. 1. 16.
Android DownloadManager 처리 WebView에서 Download를 구현해줄 때 서버에서 MIME이나 Filename을 제대로 주지 않는 경우가 많다. 따라서 다음과 같은 기본 뼈다구 작성.. webview.setDownloadListener(new DownloadListener() {@SuppressLint("DefaultLocale")@Overridepublic void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {MimeTypeMap mtm = MimeTypeMap.getSingleton();DownloadManager downloadManager = (DownloadManage.. 2012. 12. 17.
C# 에서 중복 프로그램 실행 방지하기 Program.cs에서 IO랑 Diagnostics 쓴다고 선언해주고~using System.IO; using System.Diagnostics; Main에서 Process있나 체크하고 있으면 현재 프로그램을 종료string processName = Path.GetFileNameWithoutExtension(Application.ExecutablePath); Process[] processes = System.Diagnostics.Process.GetProcessesByName(processName); if (processes.Length > 1) { MessageBox.Show("There is already another instance of the application running"); Appli.. 2012. 11. 14.
안드로이드 서비스나 액티비티에서 위젯의 onUpdate 호출하기 ACTION_APPWIDGET_UPDATE를 Broadcast하면 되는데 이때 Extra로 Widget ID를 넣어 주어야 한다. 다음과 같은 방법으로 위젯 ID들을 획득할 수 있다. mgr.getAppWidgetIds(new ComponentName(this, Widget.class)) 예제 코드를 작성하면 아래와 같다. AppWidgetManager mgr = AppWidgetManager.getInstance(this); Intent update = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE); update.setClass(this, Widget.class); update.putExtra(AppWidgetManager.EXTRA_APPWIDGET_I.. 2012. 2. 14.