ArcSDE C APiµÄC#µ÷ÓÃ
Ñ¡Á½¸ö±È½ÏÓдú±íÐԵĺ¯Êý
Ê×ÏÈÏÂÔØ°²×°sdk£¬½«ÆäÖеÄsde.dll,pe.dllºÍsg.dll¿½±´¹ýÀ´
ʹÓÃÈçϵĴúÂ룬ָ¶¨dllºóÖ±½Óµ÷ÓÃÆäÖеĺ¯Êý£¬
/// <summary>
/// Sets the value for a small integer column.
/// </summary>
[DllImport(".\\sde91.dll", SetLastError = true, ThrowOnUnmappableChar = true)]
public static extern Int32 SE_stream_set_smallint(IntPtr stream, Int16 column, sbyte[] short_val);
/// <summary>
/// Sets the value for a string column.
/// </summary>
[DllImport(".\\sde91.dll", SetLastError = true, ThrowOnUnmappableChar = true)]
public static extern Int32 SE_stream_set_nstring(IntPtr stream, Int16 column, byte[] string_val);
ÔÚ²åÈëÊý¾ÝʱʹÓõ½µÄÁ½¸öº¯Êý£¬Ò»¸öÊDzåÈëstring£¬ÁíÒ»¸öÊDzåÈësmallint£¨shortÐÍ£©
ÔÚc#ÖУ¬stringÊÇunicodeµÄ£¬ËùÒÔÐèҪʹÓú¯ÊýSE_stream_set_nstring
´Ëº¯ÊýµÄµÚÈý¸ö²ÎÊýÈçÒÔÉÏ´úÂëÖеģ¬Èç¹ûÖ±½ÓдΪstring£¬Ôò¶ÔÓÚÖÐÎÄ×Ö·û£¬³öÀ´µÄ¾ÍÊÇÂÒÂëÁË
ʹÓÃbyte£¬È»ºóµ÷ÓÃʱÈçÏ£º
ret = Stream.SE_stream_set_nstring(insertStream, 3, (new UnicodeEncoding()).GetBytes("²âÊÔ"));
¶ÔÓÚsmallintÐÍ£¬ÔÚSE_stream_set_smallintº¯ÊýÖÐÖ±½ÓʹÓÃshort£¬
Ò²³öÏÖ´íÎ󣬲»ÖªµÀΪʲô£¬ºóÀ´Ïëµ½
C#ÖеÄsbyteÊÇ8λµÄ£¬Á½¸ö×é³ÉµÄÊý×é¾ÍÊÇÒ»¸öshort(16λÓзûºÅÕûÐÍ)
È»ºóÊÔÁËÊÔ£¬¹ûÈ»¿ÉÓã¬
ʹÓõÄʱºò×¢Ò⣬±ÈÈçÒª´æÈëÒ»¸ö±äÁ¿ashort;
sbyte[0]ÖеÄÊýÖµ£¬¿ÉÒÔΪСÓÚ256µÄÖµ
µ±ÊýÖµ´óÓÚ256ʱ(1<<8)
sbyte[1]¾ÍÊÇÊýÖµashort>>8;
sbyte[0]Ϊashor-((ashort>>8)<<8)
ʹÓÃλÔËË㣬¼òµ¥·½±ãЧÂʸߣ¬²»ÖªµÀ»¹ÓÐûÓÐÆäËû²»ÐèҪת»»µÄ·½·¨
Ïà¹ØÎĵµ£º
1.ÇóÏÂÃæº¯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
int func(x)
{
int countx = 0;
while(x)
{
countx ++;
x = x&(x-1);
......
// SnakeMatrix.cpp : Defines the entry point for the console application.
// Create by Xianyi.Ye, May 4,2010
#include "stdafx.h"
#include <iostream.h>
/*
Question: Print a Sanke Matrix as following
i\j 1 2 3 4 5 6
1 1 2 9 10 25 26
2 4 3 8 11 24 27
3 5 6 7 12 23 28
4 16 15 14 ......
×÷Õß: ÍõÕßÖ®½£(http://www.albertsong.com/) ÈÕÆÚ: 2008-01-05 22:10
×ÖÌå´óС: С ÖÐ ´ó
ʾÀýÑÝʾÁËÓÃC#²Ù×÷MySQLµÄ·½·¨£¬ÌṩÁËÈý¸ö¿ÉÖØÓõÄÀàMySqlDBUtil,MySqlPageUtil,Page¡£
±¾Ê¾ÀýÓÉ C#²Ù×÷AccessÊý¾Ý¿âµÄ¼òµ¥Àý×Ó£¨http://www.albertsong.com/read-56.html£©Ð޸ĶøÀ´¡£
1.Ê×ÏÈÏÂÔ ......
1.ʱ¼ä±íʾ
ÔÚ³ÌÐòµ±ÖÐ,ÎÒÃǾ³£ÒªÊä³öϵͳµ±Ç°µÄʱ¼ä,±ÈÈçÎÒÃÇʹÓÃdateÃüÁîµÄÊä³ö½á¹û.Õâ¸öʱºòÎÒÃÇ¿ÉÒÔʹÓÃÏÂÃæÁ½¸öº¯Êý:
#include <sys/time.h>
time_t time(time_t *tloc);
char *ctime(const time_t *clock);
timeº¯Êý·µ»Ø´Ó1970Äê1ÔÂ1ÈÕ0 ......