用C#程序,在AutoCAD中用entity.explode()怎么没能分解块呢?代码如下,望解答。

using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
TypedValue[] acTypValAr5 = new TypedValue[1];
acTypValAr5.SetValue(new TypedValue((int)DxfCode.BlockName, "1"), 0);
SelectionFilter acSelFtr5 = new SelectionFilter(acTypValAr5);
PromptSelectionResult acSSPrompt5 = acEd.SelectAll(acSelFtr5);
if (acSSPrompt5.Status == PromptStatus.OK)
{
//acDoc.SendStringToExecute("explode ", true, false, true);
SelectionSet acSSet5 = acSSPrompt5.Value;
DBObjectCollection objs = new DBObjectCollection();
foreach (ObjectId acSSetObject5 in acSSet5.GetObjectIds())
{
//Entity ent5 = acTrans.GetObject(acSSetObject5.ObjectId, OpenMode.ForWrite) as Entity;
Entity ent5 = acSSetObject5.GetObject(OpenMode.ForWrite) as Entity;
if (ent5 is BlockReference)
{
BlockReference blkRef = (BlockReference)acTrans.GetObject(acSSetObject5, OpenMode.ForWrite);
BlockTableRecord btr2 = (BlockTableRecord)acTrans.GetObject(blkRef.BlockTableRecord, OpenMode.ForWrite);
blkRef.Explode(objs);

                    }

                }
            }

            acTrans.Commit();
        }
c#

2个回答

yangxuejingwu
yangxuejingwu 不是这个,这个我看过的,我选中然后用CAD的分解按钮可以分解这个块,但是我用程序怎么不行呢
大约一年之前 回复

炸开块后,需要将实体重新添加到模型空间,否则ent.Explode(objs)就没有起作用;
//
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
Entity ent = trans.GetObject(objectId, OpenMode.ForWrite) as Entity;
DBObjectCollection objs = new DBObjectCollection();
ent.Explode(objs);
foreach (DBObject obj in objs)
{
if (obj is Entity)
{
db.AddToModelSpace((Entity)obj);
}
}
if (IsDelateBlock)
{
objectId.Erase();
}
trans.Commit();
}

qq_42861135
qq_42861135 大哥为什么我的db没有那个Add的方法呢
8 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
autocad vba 块创建 插入 分解
我编写一个程序完成块创建,插入,分解。问题是在我以XYZ等比例插入时可正常分解,可如果以XYZ不同比例插入时,分解完就图形就消失了,不知为什么。而如果程序里不分解,而用手工分解则一切可达预期。rnrnrnOption ExplicitrnDim objacad As AutoCAD.AcadApplicationrnDim objcircle As AutoCAD.AcadCirclernDim objline As AutoCAD.AcadLinernDim objpoint As AutoCAD.AcadPointrnDim objarc As AutoCAD.AcadArcrnrnrnPrivate Sub Command1_Click()rnrnOn Error Resume NextrnSet objacad = GetObject(, "autocad.application")rnIf Err.Number <> 0 Thenrn MsgBox "AutoCAD没有打开"rnExit SubrnEnd Ifrnrnrnobjacad.WindowState = acMaxrnobjacad.ActiveDocument.WindowState = acMaxrnrnDim sset As AcadSelectionSet '定义选择集对象rnDim element As AcadEntity '定义选择集中的元素对象rnobjacad.ActiveDocument.SelectionSets("ss1").DeleternSet sset = objacad.ActiveDocument.PickfirstSelectionSetrnIf sset.Count = 0 ThenrnrnSet sset = objacad.ActiveDocument.SelectionSets.Add("ss1") '新建一个选择集rnrnobjacad.Visible = TruernrnMe.Hidernrnobjacad.Visible = Truernsset.SelectOnScreen '提示用户选择rnElsernMe.Hidernobjacad.Visible = TruernEnd IfrnrnrnDim blockObj As AcadBlockrnDim insertionPnt As Variantrn insertionPnt = objacad.ActiveDocument.Utility.GetPoint(, "请点击块拾取点")rnrnSet blockObj = objacad.ActiveDocument.Blocks.Add(insertionPnt, "CircleBlock")rnrnrnDorn blockObj.Item(blockObj.Count - 1).Deletern rnLoop Until blockObj.Count < 1rnrnrn' 在模型空间选择集中的实体rnDim circleObj As AcadCirclernDim irnDim retObjects() As ObjectrnDim objCollection() As ObjectrnReDim objCollection(0 To sset.Count - 1)rnFor i = 0 To sset.Count - 1rn Set objCollection(i) = sset.Item(i)rn Next irnrnretObjects = objacad.ActiveDocument.CopyObjects(objCollection, blockObj)rn' 插入块到模型空间rnDim blockRefObj As AcadBlockReferencerninsertionPnt = objacad.ActiveDocument.Utility.GetPoint(, "请点击图开放入点")rnSet blockRefObj = objacad.ActiveDocument.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", Text1(0), Text1(1), 1, 0)rnZoomExtentsrnrn ' 分解块参照rnblockRefObj.ExplodernblockRefObj.DeleternrnMe.Showrnsset.deleternEnd Subrn
我的程序,望解答。
我的程序,望解答。
多重块分解
多重块分解,可以分解CAD中不能分解的块
AutoCAD 动态块使用教程
1、创建动态块快速入门 2、动态块概述 3、使用块编辑器 4、向块中添加动态元素 5、在块编辑器中保存块
AutoCAD动态块01
此文章是在百度上收集的,为方便各位网友查找资源,特传上供网友免费下载。 本资源主要讲述的是CAD中动态块的创建。其实在CAD的帮助文件里也有相应的内容,但此文作者讲述得更详细。
AutoCAD动态块02
此文章是在百度上收集的,为方便各位网友查找资源,特传上供网友免费下载。本资源主要讲述的是CAD中动态块的创建。其实在CAD的帮助文件里也有相应的内容,但此文作者讲述得更详细。
c#程序打开autocad
目前需要解决的问题,使用c#程序自动打开autocad软件,并通过c#数组实现在autocad中画出多段线图形!!急需各位高手给与指点,越详细越好!!
C#问题,望高手解答。
显示页面代码: rnrn 前10名rn 前20名rn 前50名rn rn rn rn rn rn   rn rn后台代码: protected void Button1_Click1(object sender, EventArgs e)rn rn rn if(this.myVal.Value != null)rn rn this.TextBox1.Text =this.myVal.Value;rn rn elsern rn this.TextBox1.Text = "11111";rn rn rn怎么在 this.TextBox1.Text 中没有值显示呢,奇怪!望高手解答。
SmartSoft中用C#.Net实现AutoCAD块属性提取
SmartSoft中用C#.Net实现AutoCAD块属性提取
vb中用RND怎么用呢?
我在vb中用的access数据库,rnrs.Open "select top 10 * from SelXZGLTiKu order by RND(TiHao)", con, adOpenKeyset, adLockReadOnlyrnrn这个RND 每次随机抽出来的都是一样的,怎么弄才能让他不一样呢?
c# 代码分解上的放松
这个文档时空的,就是想看下是否可以上传文件,
C#多条件查询,代码如下!
string sql = "Select * From tuixiuxinxi Where 1=1";rn if (textBox1.Text != "")rn rn sql += " And a like '%" + textBox1.Text + "%'";rn rnrn if (textBox2.Text != "")rn rn sql += " And b like '%" + textBox2.Text + "%'";rn rn if (textBox3.Text != "")rn rn sql += " And b like '%" + textBox3.Text + "%'";rn rn if (textBox4.Text != "")rn rn sql += " And b like '%" + textBox4.Text + "%'";rn rn if (textBox5.Text != "")rn rn sql += " And b like '%" + textBox5.Text + "%'";rn rn if (textBox6.Text != "")rn rn sql += " And b like '%" + textBox6.Text + "%'";rn rn if (textBox7.Text != "")rn rn sql += " And c like '%" + textBox7.Text + "%'";rn rn if (comboBox1.Text != "")rn rn sql += " And b like '%" + comboBox1.Text + "%'";rn rn if (comboBox2.Text != "")rn rn sql += " And b like '%" + comboBox2.Text + "%'";rn rn if (comboBox4.Text != "")rn rn sql += " And b like '%" + comboBox4.Text + "%'";rn rn OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source = data.mdb");rn OleDbCommand comm = new OleDbCommand(sql, conn);rn conn.Open();rn OleDbDataAdapter da = new OleDbDataAdapter(sql,conn);rn //da.Fill(ds);rn dataGridView1.DataSource = da;rn dataGridView1.Visible = true; rnrnrnrnrn请问哪里不对了?
如下代码在C#中怎么写?
Public Sub RaisePostDataChangedEvent() Implements IPostBackDataHandler.RaisePostDataChangedEventrnrn End Subrnrn就是怎么指定实现的是接口中的方法.怎样指定到特定接口.
CAD分解多重引用块
CAD分解多重引用块,打开此工具能看到里面的命令。。。
图的块分解C++实现
Visual Studio 2008平台 实现图的块分解算法,适合图论入门学习的人员参考。
怎么在程序中用代码修改string table?
新年快乐rn谁知道吗,cstring的函数中没有这个功能的。rn谢谢。rn
怎么在程序中用代码打开资源管理器~~~~
在程序中, 点击菜单项或者按钮,能够打开资源管理器, 并且是指定的路径~~~rnrn能做到吗? 怎么做呢?
c# 多线程中用messagebox,怎么用啊?
private void button1_Click(object sender, EventArgs e)rn rn Thread ddd =new Thread(new ThreadStart(test));rn ddd.Start();rn rn private void test()rn rn while(true)rn rn for (int i = 0; i < 10000000; i++)rn rnrn if (i ==1)rn rnrn MessageBox.Show("ddddd");rn rn rn rn rn rn rn rn rn rn运行中,会弹出messagbox 框,点完又出现一个,要点几次才消失?不明白为什么?如何改才能用呢?
大数分解程序C代码
实现大数分解程序C代码,实为C语言程序设计学习过程中的练习题,有助于对C语言编程能力和算法设计能力的提高。
autocad 插入一个外部块
问题 因为需要,需要在图里指定位置插入外部块rn方法 使用VBA程序rn环境 AUTOCAD 2004rnrn因为量大,需要在图里多个位置一次插入多个外部块
AutoCAD二次开发(.Net)之动态块
1、进入块编辑页面,添加可见性到块附近 2、点击可见性状态,添加可见性状态,如下图 3、根据定义的可见性,选择要显示的图形,右击--&amp;gt;对象可见性--&amp;gt;在当前状态中显示,更改当前的可见性状态(红色框选部分),对应显示隐藏图形即可。 4、动态块的读取 public static void InitialZwBlockReference() ...
ASP.NET中用怎么用C#换行
for (int i = 0; i < 10; i++)rn rn for (int j = 0; j <= i; j++)rn rn TextBox1 .Text =TextBox1 .Text+"*";rnrn rn //此地如何写?rn rn rn rn rn如何实现每次内循环完换行一次
我用tubalar 画的表格,怎么用原来的程序不能实现用回车换行了呢。程序如下。
if keydown(keyenter!) thenrn cb_1.text=string(dw_1.getcolumnname())rn choose case lower(dw_1.getcolumnname())rn case "table2_xuhao"rn dw_1.setcolumn("table2_pingming")rn case "table2_pingming"rn dw_1.setcolumn("table2_xuhao")rn end choosernend if
怎么用正则判断如下代码??
写一个函数判断,如果输入的是2008-01-10的时候返回true,如果是‘2008-01-10’就返回falsern
用c#进行autocad二次开发
用c#进行autocad二次开发把dwg图片批量转换成xml文件,当一张图片转换完成后,怎样关闭呢?
如下代码怎么报错?
如下是原始代码rn[code=c]rnrn //for (auto* e = m_vecItemList.begin();e != m_vecItemList.end(); e++)rn for (auto* e : m_vecItemList) rn rn if (e != NULL) rn delete e; rn rn rn[/code]rnrn报错内容如下rn1>MyColorCombox.cpp(54): error C2143: 语法错误 : 缺少“,”(在“:”的前面)rn1>MyColorCombox.cpp(54): error C3531: “e”: 类型包含“auto”的符号必须具有初始值设定项rn1>MyColorCombox.cpp(55): error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>MyColorCombox.cpp(57): error C2541: “delete”: 不能删除不是指针的对象rn1>MyColorCombox.cpp(60): fatal error C1903: 无法从以前的错误中恢复;正在停止编译rnrn我使用的工具是,VS2010。rnm_vecItemList是 vector m_vecItemList;rn"//"引用的是我百度的,一种方式,也不行。。rnrn请问这个该怎么改?
代码如下:怎么修改
private void button2_Click(object sender, EventArgs e)rn rn int iWidth = this.pictureBox1.Width; //图像宽度 rn int iHeight = this.pictureBox1.Height; //图像高度rn Graphics g = this.pictureBox2.CreateGraphics(); //创建Graphics对象实例rn g.Clear(Color.White); //初始为白色rn for (int x = 0; x <= iWidth / 2; x++) //扩展图像rn rn Rectangle DestRect = new Rectangle(iWidth / 2 - x, iHeight / 2 - x, 2*x,2* x);rn Rectangle SrcRect = new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height);rn g.DrawImage(pictureBox1.Image, DestRect, SrcRect, GraphicsUnit.Pixel);rn System.Threading.Thread.Sleep(10);//图片显示速度rn rn rn想在pictureBox2中将picture1中图片以由里到外扩展方式显示出来,但是显示出来的图片只是picturebox1中的一部分,怎么完整的显示出来?
如下代码怎么modify?
[color=#FF0000] - button doesn't work and if clicked + button,then add double rows.rnrn how to modify my code. thank you[/color]rnrn[color=#FF0000]html code[/color]rnrnrn rn rn rn --------rn rn =_(.dept_name)rn rn rn rn rn --------rn rn =_(.position_name)rn rn rnrn rn rn rn =_(.user_name) [=_(.dept_name)]rn rn rn -rnrn+rnrnrn[color=#FF0000]jquery code [/color]rnrn(function($)rnrn// var btn_del = $('button.btn_del_opt');rn// var btn_add = $('button.btn_add_opt');rn rn function del_opt(obj)rn rn if($(obj).parent().parent().next().children('td').children('span').length == 1)rn rn return alert('삭제하실수 없습니다.');rn rn $(obj).parent().parent().next().last().remove();rn cont_btn();rn rn rn function add_opt(obj)rn rn console.log($(obj));rn $(obj).parent().parent().after($(obj).closest('tr').clone());rn $(obj).parent().parent().next().children('td').children('span').children('input').val('');rn cont_btn();rn rn rn function cont_btn()rn rn $('button.btn_del_opt').map(function(k,v)rn $(v).click(function()rn del_opt(this);rn );rn );rn $('button.btn_add_opt').map(function(k,v)rn $(v).click(function()rn add_opt(this);rn );rn );rn rn rn cont_btn();rn rn)(jQuery);rn
小弟初学C#,有一程序不解!望达人解答!
程序:rn 1 using System; rn 2 class UserInputMonitorrn 3 rn 4 public delegate void UserRequest(object sender,EventArgs e); rn 5 public event UserRequest OnUserRequest; rn 6 public void Run() rn 7 rn 8 if (Console.ReadLine()=="h") rn 9 OnUserRequest(this,new EventArgs());rn10 rn11 rn12 public class Clientrn13 rn14 public static void Main() rn15 rn16 UserInputMonitor monitor=new UserInputMonitor(); rn17 new Client(monitor); rn18 monitor.Run(); rn19 rn20 private void ShowMessage(object sender,EventArgs e)rn21 rn22 Console.WriteLine("HaHa!!"); rn23 rn24 Client(UserInputMonitor m)rn25 rn26 m.OnUserRequest+=new UserInputMonitor.UserRequest(this.ShowMessage);rn27 rn28 rnrn这是一个事件处理程序,用来监听键盘的输入.rn我想把24,25,26,27行去掉,改动一下第17行,可以怎么改?
请问AutoCad的空间怎么用
能否对他用程序进行用户交互呢?
如下程序怎么错了????
我下面的程序.NET告诉我程序“F:\zhengjiause\vc.net\csexe01\obj\Debug\csexe01.exe”未定义入口点,怎么回事???rnrnusing System;rnrnnamespace csexe01rnrn /// rn /// Class1 的摘要说明。rn /// rn class Class1rn rn public int x;rn /// rn /// 应用程序的主入口点。rn /// rn rn rn [STAThread]rn public void Main()rn rn //rn // TODO: 在此处添加代码以启动应用程序rn x=5;rn Console.WriteLine("the value of x is:0",x);rn Console.WriteLine("the value of this.x is:0",this.x);rnrn rn rnrn
如下错误提示,怎么解决??望指点迷津!!
我实现的功能如下:rn在窗体上放一个Button和一个Memo,从Memo输入数据,单击一下按钮,创建一个动态数组,把数据保存在数组里面。rnrn单击一下整个程序OK!,但是,功能完了过后,我重新输入,就出错了,错误信息如下:rnAccess violation at address 011941E4 in module 'BorlandMM.DLL'rnWrite of address 0000000E.Process stopped.rnrn如何解决?急盼回复!
C#自动完成代码怎么用
vs2008的自动完成代码功能,怎么用,为什么我照书上的,弄不出来呢!!!rn比如说,我想输入个for 循环,我只输入for,然后按Tab键,应该就会出来一个for循环的代码框架rnfor(i=0;i
几个c#的概念,望高手解答
值类型、引用类型、堆栈、封箱、拆箱rnrn哪位能帮我详细解答一下,谢谢!
C#逻辑题 望高手解答
求2—100中,每个数的质因子,输出如下形式:2=2,3=3,4=2*2...100=2*2*5*5)rn提示:质因子也即素数因子.在找质因子的过程中,可以不必判断它是否为素数,只要算法合适,所求的因子必然是质因子.
书上代码没看懂,望高手解答?
using System;rnusing System.Collections;rnusing System.Reflection;rnrnpublic enum RemoteServersrnrn JEANVAJEAN,rn JAVERT,rn COSETT,rnrnrnpublic class RemoteObjectAttribute:Attributernrn public RemoteObjectAttribute(RemoteServers Server)rn rn this.server = Server;rn rnrn protected RemoteServers Server;rnrn public string Serverrn rn getrn rn return RemoteServers.GetName(typeof(RemoteServers),this.server);rn rn rnrnrn[RemoteObject(RemoteServers.COSETT)]rnrnclass MyRemotableClassrnrnrnrnclass ClassAttrApprnrn Type type = typeof(MyRemotableClass);rn foreach(Attribute attr in type.GetCustomAttributes())rn rn RemoteObjectAttribute remoteAttr = attr as RemoteObjectAttribute;rn if(null != remoteAttr)rn rn Console.WriteLine("Create this object on 0",remoteAttr.Server);rn rnrn rnrnrnrnrnD:\Visual Studio Projects\31\Class1.cs(650): 类、结构或接口成员声明中的标记“foreach”无效rnD:\Visual Studio Projects\31\Class1.cs(650): 应输入 ;rnD:\Visual Studio Projects\31\Class1.cs(650): 类、结构或接口成员声明中的标记“(”无效rnD:\Visual Studio Projects\31\Class1.cs(653): 类、结构或接口成员声明中的标记“if”无效rnD:\Visual Studio Projects\31\Class1.cs(653): 类、结构或接口成员声明中的标记“)”无效rnD:\Visual Studio Projects\31\Class1.cs(655): 类、结构或接口成员声明中的标记“(”无效rnD:\Visual Studio Projects\31\Class1.cs(655): 类、结构或接口成员声明中的标记“)”无效rnD:\Visual Studio Projects\31\Class1.cs(658): 应输入类型、命名空间定义或文件尾rnrn这是讲特性的章节!rn
安卓程序出现问题,求大神解答!代码如下!
package com.example.ipesonally;rnrnimport com.example.ipesonally.DetailActivity;rnrnimport android.os.Bundle;rnimport android.app.Activity;rnimport android.app.AlertDialog;rnrnimport android.content.ContentValues;rnimport android.content.DialogInterface;rnimport android.content.Intent;rnimport android.database.Cursor;rnimport android.database.sqlite.SQLiteDatabase;rnimport android.view.LayoutInflater;rnimport android.view.Menu;rnimport android.view.View;rnimport android.view.ViewGroup;rnimport android.widget.Button;rnimport android.widget.EditText;rnimport android.widget.TextView;rnimport android.widget.Toast;rnimport android.app.AlertDialog.Builder;;rnpublic class InitActivity extends Activity rn private SQLiteDatabase myDB=null;rn private EditText edittext;rn Button button1,button2,button3;rn android.app.AlertDialog.Builder bldName,bldName2;rn private LayoutInflater fact;rn private View view;rn private String str=null;rn rn rn @Overridern protected void onCreate(Bundle savedInstanceState) rn rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_init);rn myInitGUI();rnrn rnrn public void myInitGUI()rn rn rn myDB=this.openOrCreateDatabase("myuser.db", MODE_PRIVATE, null);rn //myDB.execSQL("Create table if not exists activity1(_id INTEGER PRIMARY KEY,name TEXT,time TEXT,place TEXT,user TEXT,nowing TEXT,activityIntro TEXT,keep TEXT,take TEXT,image INTEGER)");rn button1=(Button)findViewById(R.id.button1);rn button2=(Button)findViewById(R.id.button2);rn button3=(Button)findViewById(R.id.button3);rn rn //button1.setBackgroundColor(getResources().getColor(R.color.blue)); rn rn rn public void ActivityButton(View v)rn rn edittext=(EditText)findViewById(R.id.editText1);rn str=edittext.getText().toString();rn Cursor cursor=myDB.query("activity1",null,"name='"+str+"'",null,null,null,null);rn cursor.moveToFirst();rn if(str.equals("我想去"))rn Toast toast=Toast.makeText(this, "您未输入", Toast.LENGTH_LONG);rn toast.show();rn rn rn rn rn else if(!cursor.isAfterLast())rn rn Intent it=new Intent();rn it.setClass(this,DetailActivity.class);rn rn Bundle bd=new Bundle();rn bd.putString("place", str);rn it.putExtras(bd);rn startActivity(it);rn elsern EditText etName=new EditText(this);rn etName.setText(str);rn bldName=new AlertDialog.Builder(this);rn bldName.setTitle("没有该活动");rn bldName.setMessage("请问你要创建该活动吗?");rn bldName.setView(etName);rn rn bldName.setPositiveButton("创建",new DialogInterface.OnClickListener()rn rn public void onClick(DialogInterface dialog,int which)rn CreatDio();rn //myDB.execSQL("Create table if not exists activity1(_id INTEGER PRIMARY KEY,name TEXT,time TEXT,place TEXT,user TEXT,nowing TEXT,activityIntro TEXT,keep TEXT,take TEXT)");rn //INSERT INTO activity1(name,time,place,user,nowing,activityIntro,keep,take) Values('aa:22:cc:22:ee:ff','00101','aabbcc','19');rn // myDB.insert(table, nullColumnHack, values)rn rn rn rn rn rn );rn rn bldName.setNegativeButton("Cancel",new DialogInterface.OnClickListener()rn rn public void onClick(DialogInterface dialog,int which)rn rn dialog.cancel();rn rn rn rn rn rn rn rn );rn rn AlertDialog dlg=bldName.create();rn dlg.show();rn rn rn rn rn public void FastButton1(View v)rn String str=button1.getText().toString();rn Intent it=new Intent();rn it.setClass(this,DetailActivity.class);rn rn Bundle bd=new Bundle();rn bd.putString("place", str);rn it.putExtras(bd);rn startActivity(it);rn rn rn public void FastButton2(View v)rn String str=button2.getText().toString();rn Intent it=new Intent();rn it.setClass(this,DetailActivity.class);rn rn Bundle bd=new Bundle();rn bd.putString("place", str);rn it.putExtras(bd);rn startActivity(it);rn rn rn public void FastButton3(View v)rn String str=button3.getText().toString();rn Intent it=new Intent();rn it.setClass(this,DetailActivity.class);rn rn Bundle bd=new Bundle();rn bd.putString("place", str);rn it.putExtras(bd);rn startActivity(it);rn rn rn public void CreatDio()rn fact=getLayoutInflater();rn view=fact.inflate(R.layout.newlayout, (ViewGroup)findViewById(R.id.DioLay));rn TextView creatactivity=(TextView)findViewById(R.id.test1);rn creatactivity.setText("WW");/* */rn rn rn bldName2=new AlertDialog.Builder(this);rn bldName2.setTitle("请选择");rn bldName2.setView(view);rn bldName2.setPositiveButton("OK",new DialogInterface.OnClickListener()rn rn public void onClick(DialogInterface dialog,int which)rn rn /**/rn rn rn rn rn rn rn );rn rn bldName2.setNegativeButton("Cancel",new DialogInterface.OnClickListener()rn rn public void onClick(DialogInterface dialog,int which)rn rn dialog.cancel();rn rn rn rn rn rn rn rn );rn AlertDialog dlg1=bldName2.create();rn dlg1.show();rn rn rn rn rn rnrnrnrnXML代码:rnrnrnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rn rnrn rnrn rnrn rnrn rnrn rnrn
C#串口通信的问题,很急,望高人解答!
我的电脑串口连了个modem,用VS2008建了个项目,两个textbox控件,一个Button空间,一个serialport控件,现在要和modem通信,代码如下:[code=C#]serialPort.Open();rn serialPort.WriteLine(textBox1.Text);rn textBox2.Text = serialPort.ReadLine();rn serialPort.Close();[/code]rn问题是,每次发送atz\n或atz\r\n时,textbox2都显示atz,按道理应该是返回“OK”才对啊?急求解答。通信有没有成功呢???
C#的一个简单疑惑 望解答!
rn 在web状态下rnrn 有两个命名空间 rnrn System.Web.Mailrnrn System.Net.Mail;rnrn 想咨询一下 [color=#FF0000]这两个命名空间和收发邮件[/color]的关系 以及两个命名空间的[color=#FF0000]相同点[/color]和[color=#FF0000]差异[/color]
c# 注册码 【望caozhy版主解答】
看到您回复的这个帖子:http://bbs.csdn.net/topics/390371137rn[img=https://img-bbs.csdn.net/upload/201305/30/1369899825_55352.png][/img]rn请问这样该获取什么呢,该怎么做?谢谢…
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法