[非技术]关于C#、VB.net、Asp.net的关系问题,请指点指点!

singit5 2009-03-15 10:49:47
关于这三者的关系在下不是很明了,望赐教,谢谢。
有关我的疑问:
1、C#是种语言对吧,这种语言可以写网页后台程序,如ASP.NET,也可以写c/s类软件对吗?
2、VB.net是个什么东东?是Visual Basic的某个版本(或分支),还是管ASP.NET框架下的VB语句叫做VB.net?
3、第二个问题答案如果是后者的话,是不是意味着VB.net只是做网站程序用,做软件还是Visual Basic?
4、第二个问题答案如果是前者,那么VS中,创建新项目选项中没有“VB.net应该程序”这项吗?

请就以上疑问进行解答,或进行有意义的说教,谢谢。
...全文
97 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
singit5 2009-04-05
  • 打赏
  • 举报
回复
sub page_load()	
logreset
issearch=false
isselect=false
canpost=false
id=isnum(request("id"))
dim t1 as datatable
t1=sqldatatable("select top 1 * from ***** where id="& id,1,"cc")
if t1.rows.count=0 then err_norecord
cid=t1.rows(0)("clas")
forecharm=t1.rows(0)("forecharm")
allcount=t1.rows(0)("times")
if t1.rows(0)("mbid")=14 and t1.rows(0)("mbcode")="****" then issearch=true
if t1.rows(0)("onerate")=0 then isselect=true
head_title=t1.rows(0)("title") &"-"& head_title
mainre.datasource=t1
mainre.databind
dim lastnext,wrongtxt,candis
wrongtxt=""
candis=true
lastnext=sqlsum("select top 1 convert(varchar,id)+'(0)'+title from ***** where id<"& id &" order by id desc",1)
if lastnext<>"" then lastone.text="<a href='display.aspx?id="& split(lastnext,"(0)")(0) &"'>"& getleft(split(lastnext,"(0)")(1),20) &"</a>"
lastnext=sqlsum("select top 1 convert(varchar,id)+'(0)'+title from ***** where id>"& id &" order by id asc",1)
if lastnext<>"" then nextone.text="<a href='display.aspx?id="& split(lastnext,"(0)")(0) &"'>"& getleft(split(lastnext,"(0)")(1),20) &"</a>"
if longmbid=0 then
mycharm=0
else
mycharm=sqlsum("select top 1 mbcharm from ***** where mbid="& longmbid,1)
if longmbid=t1.rows(0)("mbid") then subundo.visible=true
end if
printjs("var mycharm="& mycharm)

if t1.rows(0)("isok") then
candis=false
if t1.rows(0)("isbad") then
lastate.text="此竞猜已于 "& t1.rows(0)("badtime") &" 被处罚,处罚原因:<br>"& t1.rows(0)("badtxt")
else
lastate.text="此竞猜已于 "& t1.rows(0)("givetime") &" 正常关闭或撤销<br>正确答案:"& t1.rows(0)("answertxt") &"  本题坐庄会员获得 "& t1.rows(0)("lastcharm") &" 收益"
end if
betcharm2.visible=false
okpan.visible=false
else
if datediff("h",t1.rows(0)("timeend"),datetime.now)>48 and not issearch then
dim tt2,iic
tt2=sqldatatable("select id,mbid,givecharm from ***** where isok=0 and bid="& id,1,"cc36")
for iic=0 to tt2.rows.count-1
sqlexecute("update ***** set isok=1,backcharm=givecharm where id="& tt2.rows(iic)("id"),1)
admincharm(tt2.rows(iic)("givecharm"),61,tt2.rows(iic)("mbid"))
next
sqlexecute("update ***** set isok=1,givetime=getdate(),isbad=1,badtime=getdate(),lastcharm=-"& forecharm &",badtxt='由于坐庄会员没能在结束时间后48小时内给出结果,系统自动扣除200积分' where id="& id,1)
adminpoint(-200,46,t1.rows(0)("mbid"))
sayerr("该问题违规,现已经自动处理!","display.aspx?id="& id)
elseif datediff("h",t1.rows(0)("timeend"),datetime.now)>1 then
dim cansend
cansend=false
if isdbnull(t1.rows(0)("iswake")) then
cansend=true
else
if not(t1.rows(0)("iswake")) then cansend=true
end if
if cansend and not issearch then
sqlexecute("insert into *****(fromuserid,touserid,content,new) values(16,"& t1.rows(0)("mbid") &",'重要提醒-您的竞猜题目: ""& t1.rows(0)("title") &"" 竞猜截止时间已到,请注意及时给出结果,以免于 <b>减200积分</b> 的处罚,谢谢。<br><a href=http://www.searchina.net.cn/amuse/display.aspx?id="& id &" target=_blank><b>点击此处查看该题</b></a>|"& datetime.now &"',1)",1)
sqlexecute("update ***** set iswake=1 where id="& id,1)
end if
end if
end if
if longmbid=0 then
if wrongtxt="" then wrongtxt=logfirst("/amuse/display.aspx?id="& id,"开始下注")
candis=false
elseif datetime.now<t1.rows(0)("timestart") then
if wrongtxt="" then wrongtxt="对不起,下注期限尚未开始"
candis=false
elseif datetime.now>t1.rows(0)("timeend") then
if wrongtxt="" then wrongtxt="对不起,下注期限已经结束"
candis=false
elseif longmbid=t1.rows(0)("mbid") then
if wrongtxt="" then wrongtxt="对不起,出题人不可以下注"
candis=false
else
if mycharm<10 then
if wrongtxt="" then wrongtxt="对不起,您的魅力不到10,不可下注"
candis=false
end if
end if

if t1.rows(0)("onerate")=0 then '''选择题
openq.visible=false
selectpanel.visible=true
allcharm=t1.rows(0)("allcharm")
dim temptable as datatable,ii as integer
temptable=sqldatatable("select id,distxt,times,allcharm,convert(varchar(10),rate) as rate from ***** where bid="& id &" order by id asc",1,"dd")
if t1.rows(0)("autorate")=0 then '''固定赔率
if issearch then
maxcharm="无限"
else
'''selectbutton.autopostback="false"
dim newmax
newmax=sqlsum("select sum(allcharm*rate) from ***** where bid="& id,1)
if newmax="" then newmax=0
maxcharm=forecharm - newmax
if maxcharm<0 then maxcharm=0
if maxcharm<10 then
if wrongtxt="" then wrongtxt="对不起,该题底金已不足以下注"
candis=false
canpost=false
else
canpost=true
end if
end if
else
for ii=0 to temptable.rows.count-1
if allcharm=0 then
temptable.rows(ii)("rate")=1
else
if temptable.rows(ii)("allcharm")=0 then
temptable.rows(ii)("rate")="∞"
else
temptable.rows(ii)("rate")=formatnumber(allcharm/temptable.rows(ii)("allcharm"),-1)
end if
end if
next
maxcharm="无限"
end if
if not ispostback then
for ii=0 to temptable.rows.count-1
selectbutton.items.add(new listitem("<img height=10 src='imgs/voteline.gif' width='"& (temptable.rows(ii)("allcharm")/allcharm)*150 &"'> <b>"& temptable.rows(ii)("distxt") &"</b><br>          <font color=#494949>[赔率:1:"& temptable.rows(ii)("rate") &",可接受下注额<font color=#0283FF>"& selectmax(maxcharm,temptable.rows(ii)("rate")) &"</font>,下注情况:下注"& temptable.rows(ii)("times") &"次,下注额"& temptable.rows(ii)("allcharm") &"]</font>",temptable.rows(ii)("id")))
next
end if
else
openq.visible=true
selectpanel.visible=false
openrate=t1.rows(0)("onerate")
if issearch then
maxcharm="无限"
else
dim tempnum
tempnum=sqlsum("select sum(givecharm) from ***** where bid="& id,1)
if tempnum="" then tempnum=0
maxcharm=clng((forecharm - (clng(tempnum)*openrate))/openrate)
maxcharm=clng(maxcharm)
if maxcharm<10 and subs.visible=true then
if wrongtxt="" then wrongtxt="对不起,该题底金已不足以下注"
candis=false
end if
end if
end if
maxcharms.text=maxcharm
if wrongtxt<>"" then wrong2.text=wrongtxt
subs.visible=candis
'''if canpost and candis then selectbutton.autopostback=true
if selectbutton.selectedindex<>-1 then givemax(selectbutton.selecteditem.text)
if issearch and lastate.text="请注意:坐庄会员请在下注结束时间到期后48小时内公布结果" then lastate.text=""
printjs("var maxcharm='"& maxcharm &"'")

if not page.ispostback then
page_allload()
sqlexecute("update ***** set click=click+1 where id="& id,1)
recent.datasource=sqlreader("select mbcode,time1,atxt,givecharm,backcharm from ***** where bid="& id &" order by id desc",1)
recent.databind
end if
end sub
singit5 2009-04-05
  • 打赏
  • 举报
回复
dim constr1 as string=configurationsettings.appsettings("sqlconstr1")
dim constr2 as string=configurationsettings.appsettings("sqlconstr2")
dim conn as sqlconnection
dim objcmd as new sqlcommand
dim objread as sqldatareader


function sqlexecute(sqlstr as string,constr as string)
if isnothing(conn) then conn=new sqlconnection
if conn.state=1 then conn.close
if constr="1" then
conn.connectionstring=constr1
else
conn.connectionstring=constr2
end if
dim sqlexecute_end as long
try
conn.open
objcmd.connection=conn
objcmd.commandtext=sqlstr
sqlexecute_end=objcmd.executenonquery()
catch
dealerr
end try
conn.close
return sqlexecute_end
end function

function sqlsum(sqlstr as string,constr as string) as string
if isnothing(conn) then conn=new sqlconnection
if conn.state=1 then conn.close
if constr="1" then
conn.connectionstring=constr1
else
conn.connectionstring=constr2
end if
dim sqlsum_end
try
conn.open
objcmd.connection=conn
objcmd.commandtext=sqlstr
sqlsum_end=objcmd.executescalar()
catch
dealerr
end try
conn.close
if isdbnull(sqlsum_end) then
return ""
else
return sqlsum_end
end if
end function

function sqlreader(sqlstr as string,constr as string)
if isnothing(conn) then conn=new sqlconnection
if conn.state=1 then conn.close
if constr="1" then
conn.connectionstring=constr1
else
conn.connectionstring=constr2
end if
try
conn.open
objcmd.connection=conn
objcmd.commandtext=sqlstr
return objcmd.executereader()
catch
dealerr
end try
end function

function sqldataset(sqlstr as string,constr as string) as dataset
if isnothing(conn) then conn=new sqlconnection
if conn.state=1 then conn.close
if constr="1" then
conn.connectionstring=constr1
else
conn.connectionstring=constr2
end if
try
dim mydataset_func as new dataset
conn.open
dim mydataadapter as new sqldataadapter(sqlstr,conn)
mydataadapter.fill(mydataset_func,"customers")
return mydataset_func
catch
dealerr
end try
end function

function sqldatatable(sqlstr as string,constr as string,tablename as string) as datatable
if isnothing(conn) then conn=new sqlconnection
if conn.state=1 then conn.close
if constr="1" then
conn.connectionstring=constr1
else
conn.connectionstring=constr2
end if
try
dim mydataset_func as new dataset
dim table_func as datatable
conn.open
dim mydataadapter as new sqldataadapter(sqlstr,conn)
mydataadapter.fill(mydataset_func,tablename)
table_func=mydataset_func.tables(tablename)
return table_func
catch
dealerr
end try



end function
singit5 2009-03-15
  • 打赏
  • 举报
回复
楼上高手,不好意思追问一个:我下载了vs2005,应该如何加上VB.NET这部分?谢谢。
  • 打赏
  • 举报
回复
1.对地
2.跟Vb不是一个东西,而是微软为了Net重新写的开发语言,可以认为是VB的NET版本,但VB.NET跟VB已经不是一回事了。。虽然部分语法还类似
3.VB.NET跟C#能实现的功能都一样,都能做WinForm以及WebForm
4.没有该选项应该是你没安装VB.NET部分的内容

补充:C#及VB.NET并不止能做WinForm以及WebForm,还能做WebService等等

Net(C#)工程师是指要C#语言的开发人员
如果要VB.NET开发的也会注明VB.NET
hnpylwp 2009-03-15
  • 打赏
  • 举报
回复
同感,先顶了 接下分 嘿嘿
singit5 2009-03-15
  • 打赏
  • 举报
回复
哦,对了,补充一问:看到很多招聘“.Net(C#)工程师”职位的程序员,是指用C#制作软件而不是网站程序吧?.Net工程不能是VB型吗?
xiaowangbadandan 2009-03-15
  • 打赏
  • 举报
回复
同样有疑惑
觉得 c# ,Visual Basic ,c++这些是一类的 都是一门语言
VB.net应该是Visual Basic.net,就像还可以说c#.net,c++.net
singit5 2009-03-15
  • 打赏
  • 举报
回复
顶啊,3楼哥们说的对吗?

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧