'분류 전체보기'에 해당되는 글 159건
- 2009.07.07 모바일 가계부 : 기초자료 수집 #1 1
- 2009.07.03 [Mobile] 화면 회전시 Loding 화면 구현 MV6.0
- 2009.06.30 포멧 1
- 2009.06.20 마지막 날짜 구하는 DateTiem 3
- 2009.06.04 WM6.0 자동 네트워크 접속
- 2009.05.28 Mobile 5.0 Screen 화면 전환
- 2009.05.22 크레들리 연결 상태 체크
- 2009.05.20 폼과 폼사이의 이벤트 처리
- 2009.05.19 DateTime 달별 마지막 날짜 구하기
- 2009.05.15 C# Assembly 버전 정보
1. 메인 화면 2. 기능 수행 화면 3. 메인에서 기능 수행 화면 회전시 보기 안좋은 화면 가리기용 Loding 화면 이 필요합니다.(TEST 환경) |
main
using System; namespace Motion private void button1_Click(object sender, EventArgs e) LoadForm90 lform = new LoadForm90(); subForm subform = new subForm(lform); SystemSettings.ScreenOrientation = ScreenOrientation.Angle0; |
Load form 들은 생성자에만 아래와 같이 구현
public LoadForm90() { InitializeComponent(); this.Refresh(); Application.DoEvents(); } |
subForm
using System; namespace Motion private void subForm_Load(object sender, EventArgs e) |
버튼을 클릭하면 우선 노란색으로 변한뒤에 화면이 회전한다
그 후에 노란색 화면이 사라지면서 내용이 보여진다
// This code example demonstrates the String.Format() method. // Formatting for this example uses the "en-US" culture.
using System; class Sample { enum Color { Yellow = 1, Blue, Green }; static DateTime thisDate = DateTime.Now;
public static void Main() { // Store the output of the String.Format method in a string. string s = "";
Console.Clear();
// Format a negative integer or floating-point number in various ways. Console.WriteLine("Standard Numeric Format Specifiers"); s = String.Format( "(C) Currency: . . . . . . . . {0:C}\n" + "(D) Decimal:. . . . . . . . . {0:D}\n" + "(E) Scientific: . . . . . . . {1:E}\n" + "(F) Fixed point:. . . . . . . {1:F}\n" + "(G) General:. . . . . . . . . {0:G}\n" + " (default):. . . . . . . . {0} (default = 'G')\n" + "(N) Number: . . . . . . . . . {0:N}\n" + "(P) Percent:. . . . . . . . . {1:P}\n" + "(R) Round-trip: . . . . . . . {1:R}\n" + "(X) Hexadecimal:. . . . . . . {0:X}\n", -123, -123.45f); Console.WriteLine(s);
// Format the current date in various ways. Console.WriteLine("Standard DateTime Format Specifiers"); s = String.Format( "(d) Short date: . . . . . . . {0:d}\n" + "(D) Long date:. . . . . . . . {0:D}\n" + "(t) Short time: . . . . . . . {0:t}\n" + "(T) Long time:. . . . . . . . {0:T}\n" + "(f) Full date/short time: . . {0:f}\n" + "(F) Full date/long time:. . . {0:F}\n" + "(g) General date/short time:. {0:g}\n" + "(G) General date/long time: . {0:G}\n" + " (default):. . . . . . . . {0} (default = 'G')\n" + "(M) Month:. . . . . . . . . . {0:M}\n" + "(R) RFC1123:. . . . . . . . . {0:R}\n" + "(s) Sortable: . . . . . . . . {0:s}\n" + "(u) Universal sortable: . . . {0:u} (invariant)\n" + "(U) Universal sortable: . . . {0:U}\n" + "(Y) Year: . . . . . . . . . . {0:Y}\n", thisDate); Console.WriteLine(s);
// Format a Color enumeration value in various ways. Console.WriteLine("Standard Enumeration Format Specifiers"); s = String.Format( "(G) General:. . . . . . . . . {0:G}\n" + " (default):. . . . . . . . {0} (default = 'G')\n" + "(F) Flags:. . . . . . . . . . {0:F} (flags or integer)\n" + "(D) Decimal number: . . . . . {0:D}\n" + "(X) Hexadecimal:. . . . . . . {0:X}\n", Color.Green); Console.WriteLine(s); } } /* This code example produces the following results:
Standard Numeric Format Specifiers (C) Currency: . . . . . . . . ($123.00) (D) Decimal:. . . . . . . . . -123 (E) Scientific: . . . . . . . -1.234500E+002 (F) Fixed point:. . . . . . . -123.45 (G) General:. . . . . . . . . -123 (default):. . . . . . . . -123 (default = 'G') (N) Number: . . . . . . . . . -123.00 (P) Percent:. . . . . . . . . -12,345.00 % (R) Round-trip: . . . . . . . -123.45 (X) Hexadecimal:. . . . . . . FFFFFF85
Standard DateTime Format Specifiers (d) Short date: . . . . . . . 6/26/2004 (D) Long date:. . . . . . . . Saturday, June 26, 2004 (t) Short time: . . . . . . . 8:11 PM (T) Long time:. . . . . . . . 8:11:04 PM (f) Full date/short time: . . Saturday, June 26, 2004 8:11 PM (F) Full date/long time:. . . Saturday, June 26, 2004 8:11:04 PM (g) General date/short time:. 6/26/2004 8:11 PM (G) General date/long time: . 6/26/2004 8:11:04 PM (default):. . . . . . . . 6/26/2004 8:11:04 PM (default = 'G') (M) Month:. . . . . . . . . . June 26 (R) RFC1123:. . . . . . . . . Sat, 26 Jun 2004 20:11:04 GMT (s) Sortable: . . . . . . . . 2004-06-26T20:11:04 (u) Universal sortable: . . . 2004-06-26 20:11:04Z (invariant) (U) Universal sortable: . . . Sunday, June 27, 2004 3:11:04 AM (Y) Year: . . . . . . . . . . June, 2004 Standard Enumeration Format Specifiers (G) General:. . . . . . . . . Green (default):. . . . . . . . Green (default = 'G') (F) Flags:. . . . . . . . . . Green (flags or integer) (D) Decimal number: . . . . . 3 (X) Hexadecimal:. . . . . . . 00000003 */ 이게 전부인거 같아요. 한번 실행해 보시고... 판단해야할거 같네요 | |
인터넷 접속을 통한 자동 접속 방법 1 [using System.Net;] webreq = System.Net.WebRequest.Create(url); bool success = false; |
그리고 요청 사항이였던 이넘 ;;
OpenNETCF <-- 설치해야 한다.
http://opennetcf.com/ 에서 다운 받으면 됨
private void typeConnection(string typeName) { DestinationInfoCollection DIC = connMgr.EnumDestinations(); try { foreach (DestinationInfo di in DIC) { if (di.Description == "The Internet") // (di.Description == typeName) { connMgr.Connect(di.Guid, true, ConnectionMode.Asynchronous); } } } catch (Exception er) { MessageBox.Show(er.ToString()); } } |
AdapterCollection adapters = Networking.GetAdapters(); foreach (Adapter adapter in adapters) ConnectionManager connMgr = new ConnectionManager(); bool connected = false;
|
using System; private void button1_Click(object sender, EventArgs e) |
2. UI 관련
0. Base : Panel => 기본적으로 폼 위에 Panel을 올리고 속성에서 Dock : Fill 1. 화면 전환 : Button => 속성에서 Dock : Top 2. textBox1 : 화면 각도 표시 => 속성에서 Dock : Top 3. 하나,둘... : Grid => 속성에서 Dock : Top 4. textBox2 : 해상도 표시 => 속성에서 Dock : Bottom |
=> Result
| ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
|
frm.ShowDialog를 하시기 전에
frm.FormClosing 이나 frm.FormClosed 이벤트 핸들러를 등록하시면
폼이 닫히는것을 감지하여 핸들러 메소드가 실행되게 됩니다.
이런식이 되겠네요
public Form1()
{
InitializeComponent();
Form2 frm = new Form2();
frm.FormClosing += new FormClosingEventHandler(frm_FormClosing);
frm.ShowDialog();
}
void frm_FormClosing(object sender, FormClosingEventArgs e)
{
// 실행할 메소드 호출
Temp();
}
void Temp()
{
MessageBox.Show("폼 닫혔음");
}
1. 해당 달의 첫날을 DateTime형 변수에 넣고. Date.AddMonths(1) 한후 Date.AddDay(-1) 하면 되요
2. msdn보니 방법이 있네여 System.DateTime.DaysInMonth(년도,월); 답변감사 드립니다.
3. 날짜 계산 하기
1)
TimeSpan timeSpan = Convert.ToDateTime(retDay) - Convert.ToDateTime(toDay);
=> 12.00:00:00
2)
DateTime d1 = DateTime.Today; //오늘날자
DateTime d2 = DateTime.Today.AddDays(8); //8일을 더한다
TimeSpan sp = d2.Subtract(d1); //두날자를 뺀다
label1.Text = sp.TotalDays.ToString(); //타입스팬을 날자로 변겨한다
3)
DateTime d1 = DateTime.Today; //오늘날자
DateTime d2 = DateTime.Today.AddDays(8); //8일을 더한다
TimeSpan sp = d2.Subtract(d1); //두날자를 뺀다
label1.Text = sp.TotalDays.ToString(); //타입스팬을 날자로 변겨한다
=> 이렇게 했을 때는 소수점까지 나올수 있습니다. 시간차이를 날짜수로 바꿔서 표현하기 때문입니다.
시간이하의 값을 무시할 경우에는
sp.Days.ToStirng() 처리하면 됩니다.
만약 2.11:20:30 라면
TotalDays를 사용할 경우 2.**** 식으로 표현되고. (double형)
Days를 쓰면 2가 되는 것이죠.(int형)
Version ver = assembly.GetName().Version; <-버전 클래스
------ 꼽사리 ------ powerPoint
using System;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;
namespace ExtractImage
{
class Program
{
[STAThread]
static void Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine("Usage: {0} powerpoint.ppt", System.Windows.Forms.Application.ExecutablePath);
return;
}
string fileName = args[0];
FileInfo info = new FileInfo(fileName);
ExtractImage(info.FullName);
}
static void ExtractImage(string fileName)
{
ApplicationClass app = new ApplicationClass();
Presentation ppt =
app.Presentations.Open(fileName, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);
Regex re = new Regex(@".ppt$", RegexOptions.IgnoreCase);
string imgFile = re.Replace(fileName, "");
for (int i = 0; i < ppt.Slides.Count; ++i)
{
ppt.Slides[i + 1].Export(imgFile + i + ".png", "PNG", 960, 720);
}
ppt.Close();
app.Quit();
}
}
}