gc.collect() 怎么用,和using有什么关系?用了using是不是就不用回收了?

gc.collect() 怎么用,和using有什么关系?用了using是不是就不用回收了?

c#

3个回答

C#中有托管代码和非托管代码

简单的来说就是 使用using之后你自己不用回收了 只不过是.net的内部运行机制帮你自行回收了

典型的应用就是打开数据库连接的时候
你使用using 就可以不用释放数据库连接 否则的话就要自己手动释放连接

主要你不了解GC 你应该看看 什么是GC 以及其作用
http://kb.cnblogs.com/page/106720/
GC工作方式
http://blog.csdn.net/tb12315/article/details/7883663

Using
一个是导某个命名空间,一个是在数据访问层中可以自动关闭和释放连接

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
为什么用了using System.Drawing还需要using System.Drawing.Drawing2D
如题,刚开始没加using System.Drawing.Drawing2Drn结果HatchBrush不能用,于是加上上面一句。rn我想知道的是,为什么还需要加这一句
用Using结构之后,是不是就不需要在里面close了?
[code=C#]rn Using sr As New StreamReader(FileName, System.Text.Encoding.Default)rn Me.txtDataName.Text = dataNamern Me.Tec.Text = Me.Tec.Text & sr.ReadToEnd.Trimrn sr.Close()rn End Usingrn[/code]rnrn这个using 结构中的sr.Close() 还需要嘛?rnrn今天用了FxCop检测之后 提示 contains possible code paths that dispose 'sr' multiple times. Change this behavior so that Close or Dispose is only called once or ensure that the Dispose implementation of ''sr'' is reentrant." 意思应该是重复 Close or Dispose 了?
请问using是怎么用的
请问下列程序中的using B::f 和using B::g是何作用rn再请问类D继承于B,但没加继承的权限,这什么意思rnrn#include rnclass Brnrnpublic:rn void f(char)rn rn printf("In B::f()\n");rn rnrn void g(char)rn rn printf("In B::g()\n");rn rn;rnrnclass D : Brnrnpublic:rn using B::f;rn using B::g;rn void f(int)rn rn printf("In D::f()\n");rn f('c');rn rnrn void g(int)rn rn printf("In D::g()\n");rn g('c');rn rn;rnrnvoid main()rnrn D myD;rn myD.f(1);rn myD.g('a');rn
using namespace到底是怎么用的
之前用的最多的是rnusing namespace stdrn今天看到一段代码rnusing system namespace A.b.crnclass Brnnamespace后面可以这么命名么?rn搜了一下又看到rnusing systemrnusing system.iornnamespace Arnclass Brn彻底凌乱了,这三种写法到底什么意思rn还有我要外部调用命名A中的CALSS B是不是都是A::B.xxrn感觉using xxxx有点像C++里的#include但是好像不用担心重复使用会报错的问题?
using OWC11 和 using Microsoft.Office.Interop.Owc11有什么不同?
为什么一台机子要用rnusing OWC11引用,(使用using Microsoft.Office.Interop.Owc11引用提示找不到)rn另一台机子要用rnusing Microsoft.Office.Interop.Owc11引用?rnrn两台机子上都装了office 2003,为什么引用会不同?
是不是不可以在控制台程序下用using System.Window.Forms啊
是不是不可以在控制台下用using System.Window.Forms啊
using AS
GNU as assembler
using (.....)
是什么意思啊?
@using
为什么要用@using?rnrn[code=C#]rn@using (Html.BeginForm())rn rn rn rn 帐号信息rn rn rn 帐号:rn @Html.TextBox("username")rn @Html.ValidationMessage("username")rn rn rn rn 密码:rn @Html.Password("password")rn @Html.ValidationMessage("password")rn rn rn @Html.CheckBox("rememberMe")rn rn 下次自动登录(公共电脑上谨慎使用)rn rn rn rn rn @Html.ActionLink("还没有账号?立即注册", "Register")rn rn rnrn[/code]
#using
vc2010中,不知道如何查看库中东东的定义。rn请高手指点。
using声明和using编译
using声明使得空间中特定的名称可用,using编译使得整个名称空间可用。后者很方便,可以用在学习中但不提倡。而using声明可能会导致名称冲突, 例如:using one::put;             using two::put;             put=4; 所以第三种选择是使用作用域解析运算符:: 在最常见的std名称空间中,使用using编译时可以使用 co
using声明和using指示
转载:https://blog.csdn.net/mlyjqx/article/details/74783811
using声明和using指示符
下面两种情况为什么只有第一种编译报错?rn一:rnnamespace aarnint a();rnrnrnint a();rnrnusing aa::a;//错误rnrn二:rnnamespace aarnint a();rnrnrnint a();rnrnusing namespace aa;
using()
using(SqlConnection con=new SqlConnection(ConfigurationManager.ConnectionStrin[0].ConnectionString))rn rn rn 请问这个using代码块怎样理解,代码块里面又可以放哪些内容
--using
适合所有初中级工程师,从RxJava的每个知识点进行讲解,并在每个知识点中都带有文字说明和代码例子说明。通过这次系统化的学习,您将可以完整的学习到RxJava家族的所有特性和常用的操作符,掌握操作符的使用,掌握RxJava与Rx其他第三方库的使用。可以用三句简单的话进行概括rnrn面试加分利器 = 加大录取机会rn加快工作效率 = 早点下班回家rn系统化的学习 = 能力全面提升
Using
本课程主要讲解了RxJava的多线程&辅助操作&转换操作&组合操作等。
using System;using System;using System;
using System; using System.IO; using System.Text.RegularExpressions; using System.Windows.Forms; using Microsoft.Win32; namespace MRU { public partial class FormMRU : Form { public FormMRU() { #region InitializeComponent(); ListView listViewMRU = new ListView(); listViewMRU.Dock = DockStyle.Fill; listViewMRU.HeaderStyle = ColumnHeaderStyle.None; // 隐藏列标题。 listViewMRU.View = View.Details; // 详细信息。 listViewMRU.CheckBoxes = true; // 显示复选框。 listViewMRU.Scrollable = false; // 隐藏滚动条。 listViewMRU.ShowGroups = true; // 分组显示项。 listViewMRU.BeginUpdate(); ListViewGroup pro = listViewMRU.Groups.Add("profile", "profile"); listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Recent)).Group = pro; listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Cookies)).Group = pro; listViewMRU.Items.Add(Path.GetTempPath()).Group = pro; listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.History)).Group = pro; listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)).Group = pro; ListViewGroup reg = listViewMRU.Groups.Add("regedit", "regedit"); listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Paint").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad").Group = reg; ColumnHeader column = listViewMRU.Columns.Add(""); column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); // 自动调整列宽。 listViewMRU.EndUpdate(); listViewMRU.ItemChecked += new ItemCheckedEventHandler(listViewMRU_ItemChecked); this.Controls.Add(listViewMRU); this.ClientSize = new System.Drawing.Size(column.Width + 8, 260); this.Text = Environment.UserName; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; // 禁用手动调整大小。 this.SizeGripStyle = SizeGripStyle.Hide; // 隐藏调整大小手柄。 this.StartPosition = FormStartPosition.CenterScreen; // 在桌面居中显示。 #endregion } #region ListView_ItemChecked private void listViewMRU_ItemChecked(object sender, ItemCheckedEventArgs e) { if (!e.Item.Checked) return; DirectoryInfo dir = new DirectoryInfo(e.Item.Text); switch (e.Item.Index) { case 0: case 1: foreach (FileInfo info in dir.GetFiles()) { if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。 continue; this.Text = info.Name; info.Delete(); } break; case 2: foreach (FileSystemInfo info in dir.GetFileSystemInfos()) { try { if (info is FileInfo) info.Delete(); else (info as DirectoryInfo).Delete(true); } catch { continue; } finally { this.Text = info.Name; } } break; case 3: System.Diagnostics.Process.Start(e.Item.Text); break; case 4: foreach (FileInfo info in dir.GetFiles("*.*", SearchOption.AllDirectories)) { if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。 continue; try { info.Delete(); } catch { continue; } finally { this.Text = info.Name; } } break; case 5: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\TypedURLs")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; case 6: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; case 7: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32")) { foreach (string mru in subKey.GetSubKeyNames()) { subKey.DeleteSubKeyTree(mru); } } break; case 8: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; case 9: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; } this.Text = Environment.UserName; } #endregion } }using System; using System.IO; using System.Text.RegularExpressions; using System.Windows.Forms; using Microsoft.Win32; namespace MRU { public partial class FormMRU : Form { public FormMRU() { #region InitializeComponent(); ListView listViewMRU = new ListView(); listViewMRU.Dock = DockStyle.Fill; listViewMRU.HeaderStyle = ColumnHeaderStyle.None; // 隐藏列标题。 listViewMRU.View = View.Details; // 详细信息。 listViewMRU.CheckBoxes = true; // 显示复选框。 listViewMRU.Scrollable = false; // 隐藏滚动条。 listViewMRU.ShowGroups = true; // 分组显示项。 listViewMRU.BeginUpdate(); ListViewGroup pro = listViewMRU.Groups.Add("profile", "profile"); listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Recent)).Group = pro; listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Cookies)).Group = pro; listViewMRU.Items.Add(Path.GetTempPath()).Group = pro; listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.History)).Group = pro; listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)).Group = pro; ListViewGroup reg = listViewMRU.Groups.Add("regedit", "regedit"); listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Paint").Group = reg; listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad").Group = reg; ColumnHeader column = listViewMRU.Columns.Add(""); column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); // 自动调整列宽。 listViewMRU.EndUpdate(); listViewMRU.ItemChecked += new ItemCheckedEventHandler(listViewMRU_ItemChecked); this.Controls.Add(listViewMRU); this.ClientSize = new System.Drawing.Size(column.Width + 8, 260); this.Text = Environment.UserName; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; // 禁用手动调整大小。 this.SizeGripStyle = SizeGripStyle.Hide; // 隐藏调整大小手柄。 this.StartPosition = FormStartPosition.CenterScreen; // 在桌面居中显示。 #endregion } #region ListView_ItemChecked private void listViewMRU_ItemChecked(object sender, ItemCheckedEventArgs e) { if (!e.Item.Checked) return; DirectoryInfo dir = new DirectoryInfo(e.Item.Text); switch (e.Item.Index) { case 0: case 1: foreach (FileInfo info in dir.GetFiles()) { if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。 continue; this.Text = info.Name; info.Delete(); } break; case 2: foreach (FileSystemInfo info in dir.GetFileSystemInfos()) { try { if (info is FileInfo) info.Delete(); else (info as DirectoryInfo).Delete(true); } catch { continue; } finally { this.Text = info.Name; } } break; case 3: System.Diagnostics.Process.Start(e.Item.Text); break; case 4: foreach (FileInfo info in dir.GetFiles("*.*", SearchOption.AllDirectories)) { if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。 continue; try { info.Delete(); } catch { continue; } finally { this.Text = info.Name; } } break; case 5: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\TypedURLs")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; case 6: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; case 7: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32")) { foreach (string mru in subKey.GetSubKeyNames()) { subKey.DeleteSubKeyTree(mru); } } break; case 8: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; case 9: using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List")) { foreach (string mru in subKey.GetValueNames()) { subKey.DeleteValue(mru); } } break; } this.Text = Environment.UserName; } #endregion } }
using的用法我看不懂using在这里怎么是用?
using (SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["SqlConnStr"]))rn rn // The command to increment the number of views a picture hasrn SqlCommand cmd = new SqlCommand("UPDATE pics SET numviews=@numviews WHERE id=@picid", conn);rn cmd.Parameters.Add("@numviews", SqlDbType.Int).Value = numViews;rn cmd.Parameters.Add("@picid", SqlDbType.Int).Value = picid;rnrn conn.Open();rn cmd.ExecuteNonQuery();rn conn.Close();rn
using的用法有哪些?
using有三种用法: 1.using除了作用域,还可以自动释放内容 2.引用名称空间 3.给类取别名
用using System.Web.Mail出错
写的是WindowApplication,VS2003。已经在开头加入using System.Web;rnusing System.Web.Mail;。但是编译的时候就是出错提示信息如下——rnrnD:\Email\Form1.cs(8): 类型或命名空间名称“Mail”在类或命名空间“System.Web”中不存在(是否缺少程序集引用?)rnrn请问是什么问题,该如何解决呢?谢谢~
重载和using声明、using指示
using 声明: using 命名空间::成员; 一次只引入命名空间中的1个成员。令名字在局部作用域有效,外层作用域的同名实体将被隐藏。 using 指示: using namespace 命名空间; 使得某个特定的命名空间中名字都可见。令整个命名空间内容都有效,而通常命名空间中含有一些不能出现在局部作用域的定义,因此,using指示一般看作出现在最近的外层作用域中。
为啥用using语句
using语句作用: using System; //using指令   不是using语句 using System.IO; //using指令   不是using语句       namespace UsingStatement {     class Program     {         static void Main(string[] args)      
using 什么时候用
public AccountInfo SignIn(string userId, string password) rn SqlParameter[] signOnParms = GetSignOnParameters();rn signOnParms[0].Value = userId;rn signOnParms[1].Value = password;rn using (SqlDataReader rdr = SQLHelper.ExecuteReader(SQLHelper.CONN_STRING_NON_DTC, CommandType.Text, SQL_SELECT_ACCOUNT, signOnParms)) rn ...rn rnrnrn请问这里为什么要用using,一直不太明白这里用using的意思,请明白的您告诉我,谢谢!
怎么没有using Excel???
导出数据到excel中不是要命名空间using Excel吗?怎么我命名不出来?是不是要先导入什么dll或类什么的东西?谢~!
C# using 怎么不起作用?
我在namespace DXOA.Components中定义了一个类:rnnamespace DXOA.Componentsrnrn /// rn /// 部门处理类rn /// rn public class Positionrn rn……rnrn在别外的文件中进行了引用:rnusing DXOA.Components;rnrn奇怪的是当我需要调用Position类的静态方法时,总要这样写才行:DXOA.Components.Position.method1();而不能直接写成Position.method1();那我的using DXOA.Components不是没起作用吗?
C#怎么使用USING
我怎么才能在一个项目中使用using namespace2;rn去条用namespace2.rnrn我创建了2个项目名称分别为namespace1, namespace2rnrn现在我在namespace1中写,using namespace2; 并不能调用namespace2的任何东西。rn提示我,找不到类型或命名空间名称。rn这是为什么?是不是和放的位置有关?rn求高手指教。。
怎么不能using Excel
为什么我不能using Excel,说找不能命名空间
using (reader)用与不用有什么区别?
using (reader)rn rn while (reader.Read())rn rn if (!reader.GetValue(0).Equals(DBNull.Value))rn rn listUserCode.Add(reader.GetString(0));rn rn rn rn用了 using (reader)和不用有什么区别吗?不用也行的啊?
这个using是什么意思,和using System; 的using是一样的吗?
public CustomerData GetCustomerByEmail(String emailAddress, byte [] password)rnrn//rn// Check preconditionsrn//rnApplicationAssert.CheckCondition(emailAddress != String.Empty, "Email address is required", ApplicationAssert.LineNumber);rnApplicationAssert.CheckCondition(password.Length != 0, "Password is required", ApplicationAssert.LineNumber);rn//rn// Get the customer dataSetrn//rnCustomerData dataSet;rnusing (DataAccess.Customers customersDataAccess = new DataAccess.Customers())rnrn dataSet = customersDataAccess.LoadCustomerByEmail(emailAddress);rnrn// rn// Verify the customer's passwordrn//rnDataRowCollection rows = dataSet.Tables[CustomerData.CUSTOMERS_TABLE].Rows;rn rnif ( ( rows.Count == 1 ))rnrn byte [] dbPassword = (byte[])rows[0][CustomerData.PASSWORD_FIELD];rnrn if (ComparePasswords (dbPassword, password))rn return dataSet;rn elsern return null;rnrn elsern return null;rn
vs2005中的新语句using怎么用?
Declares the beginning of a Using block and optionally acquires the system resources that the block controls.rnrn rnUsing resourcelist | resourceexpression rn [ statements ]rnEnd Usingrn rnrnPartsrnresourcelist rnrnrnRequired if you do not supply resourceexpression. List of one or more system resources this Using block controls. Multiple resources are separated by commas. rnresourceexpression rnrnrnRequired if you do not supply resourcelist. Variable or expression referring to a system resource this Using block controls. If you supply resourceexpression, you must acquire the resource before passing control to the Using statement. rnstatements rnrnrnOptional. A block of statements the Using block runs. rnEnd Using rnrnrnRequired. Terminates the Using block and disposes of all the resources it controls. rnEach resource in the resourcelist part has the following syntax and parts:rnrn哪位老大能翻译过来~rn
Using 语句块怎么用啊
Using 语句块怎么用啊
using name space该怎么用?
如下程序怎么这样是对的,有两个文件,分别是Clock.H,Clock.cpprnrn File CLocl.H:rn#ifndef H_Clockrn#define H_Clockrn#includernusing std::ostream;rnclass Clockrnrnpublic:rn int getHour();rn int getMinute();rn int getSecond();rn void setTime(int,int,int);rn void getTime(int&,int&,int&);rn void incrementHour();rn void incrementMinute();rn void incrementSecond();rn Clock(int,int,int);rn Clock(const Clock&);rn friend ostream& operator<< (ostream&,const Clock&); rnprivate:rn int hour;rn int minute;rn int second;rn;rnrn#endifrnrnFile CLock.cpprn#include "Clock.h"rnusing namespace std;rnrnint Clock::getHour()rnrn return hour;rnrnint Clock::getMinute()rnrn return minute;rnrnint Clock::getSecond()rnrn return second;rnrnvoid Clock::incrementHour()rnrn hour = (++hour)%24;rnrnvoid Clock::incrementMinute()rnrn minute = (++minute)%60;rn if (minute==0)rn incrementHour();rnrnvoid Clock::incrementSecond()rnrn second = (++second)%60;rn if (second == 0)rn incrementMinute();rnrnvoid Clock::setTime(int hour,int minute,int second)rnrn this->hour = hour;rn this ->minute = minute;rn this->second = second ;rnrnvoid Clock::getTime(int&hour,int&minute,int&second)rnrn hour = this->hour ;rn minute = this->minute;rn second = this->second;rnrnClock::Clock(int hour,int minute,int second)rnrn this->hour = hour ;rn this ->minute = minute ;rn this->second = second ;rnrnClock::Clock(const Clock& aClock)rnrn hour = aClock.hour ;rn minute = aClock.minute ;rn second = aClock.second ;rnrnostream& operator<< (ostream& os,const Clock &clock)rnrn os<
using WMPREVIEWLib 需要怎么以用这个
using WMEncoderLib;rnrnusing WMPREVIEWLib;rnrnrnrnrn我在程序中同时引用了 这两个 但是提示 WMPREVIEWLib缺少命名空间 rnrn在引用中我只引用了 WMEncoderLib 和 WMEncPrivateTlbrnrnrn那么WMPREVIEWLib 在哪引用呢
用using System.Net.Mail怎么设置代理服务器啊
公司是通过代理服务器上网的rnsmtp.Host = "smtp.xx.com";rn这样就不行了,该怎么弄啊
怎么我用using System.Data.ADO;出错
Rt
实际开发中 using namespace 和 :: 都是怎么用的?
看情况哪个合适用哪个么?有没有强制全部用 :: 的?还有 using xx::xx;
有个问题请教,我用了using Wystem.Web,using System.Web.UI这两个语句出错
出错信息为:类型或命名空间名称“Web”在类或命名空间“System”中不存在(是否缺少程序集引用?)
using System.Data 都不能使用了,是什么情况
VS 2005里的,rnrn和web.config里的配置有关系么rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn -->rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn
有了using System.Web.UI.WebControls;可以不要:using Microsoft.Web.UI.WebControls; 不?
using System.Web.UI.WebControls;与:using Microsoft.Web.UI.WebControls; 有什么区别?rnrn 可不可以同进引用呢rnrn如果不能最好引用那一项呢?
c#读写流时使用using与不使用using 有什么区别?
使用HttpWebRequest上传文件时,使用using(Stream requstStream = request.getRequestStream()) do ......rnHttpWebResponse response = (HttpWebResponse)request.GetResponse();rn using (Stream responseStream = response.GetResponseStream())rn using (StreamReader reader = new StreamReader(responseStream))rn rn responseData.Append(reader.ReadLine());rn rn总是提示强制关闭基流,而不使用using时,Stream requestStream = request.getRequestStream(); do..... request.close();又没有错误了。rn请问使用using和不使用using有什么区别吗?
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview