import&和有什么区别?使用 [英] what is the difference between import & using

查看:79
本文介绍了import&和有什么区别?使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我面临导入和使用之间的问题区别?
有人说import在vb中有效,而using在c#中有效.
有人说当您在使用"工作背后使用代码时,其他情况则是导入"工作.
我很困惑.有人能给我正确答案吗?




在此先感谢

Hi,

i faced the question difference between import and using ?
some say import works in vb where as using works in c# .
some say when u use code behind ''using'' works else ''import'' works.
i am confused.can somebody give me the correct answer.




thanks in advance

推荐答案

Import在VB中用于导入"命名空间.
using在C#中用于导入"命名空间,或者它定义了将在其末尾放置对象的范围.

使用C# [在VB中导入语句 [
Import is used in VB to "import" a namespace.
using is used in C# to "import" a namespace or it defines a scope at the end of which an object will be disposed

using C#[^]

Imports Statement in VB[^]


导入/使用名称空间取决于您选择用来创建应用程序的语言.

Import语句特定于 VB.NET .
using语句特定于 C#.

例如,如果要在应用程序中使用名称空间System.Data.SqlClient,则:

在C#中,您编写:

import/using a namespace depends on which language you have chosen to create your application.

The Import statement is VB.NET specific.
The using statement is C# specific.

for example if you want to use the namespace System.Data.SqlClient in your application then:

In C# you write:

using System.Data.SqlClient;



在VB.net中,您可以这样写:



In VB.net you write:

Imports System.Data.SqlClient



它们都执行相同的操作,但是它们特定于该特定语言.

希望对您有所帮助:)



They both perform the same thing, but they are specific to that particular language.

hope it helps :)


希望对您有所帮助,

导入 [使用 [
Hope it helps,

Imports[^]

Using[^]

:)


这篇关于import&和有什么区别?使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆